< prev index next >

## src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java

Print this page

    @@ -34,10 +34,11 @@
     import javax.swing.plaf.*;
     import javax.swing.text.View;

     import java.awt.event.ActionEvent;
     import java.awt.event.ActionListener;
    +import java.awt.event.InputEvent;
     import java.awt.event.KeyEvent;
     import java.awt.Component;
     import java.awt.Container;
     import java.awt.Dimension;
     import java.awt.Rectangle;

    @@ -400,10 +401,13 @@
                     SwingUtilities.replaceUIInputMap(l,
                                     JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
                 }
                 inputMap.clear();
                 inputMap.put(KeyStroke.getKeyStroke(dka, BasicLookAndFeel.getFocusAcceleratorKeyMask(), false), "press");
    +            inputMap.put(KeyStroke.getKeyStroke(dka,
    +                    BasicLookAndFeel.getFocusAcceleratorKeyMask() |
    +                            InputEvent.ALT_GRAPH_DOWN_MASK, false), "press");
             }
             else {
                 InputMap inputMap = SwingUtilities.getUIInputMap
                                 (l, JComponent.WHEN_IN_FOCUSED_WINDOW);
                 if (inputMap != null) {

    @@ -518,10 +522,13 @@
                         SwingUtilities.replaceUIInputMap(label, JComponent.WHEN_FOCUSED, inputMap);
                     }
                     int dka = label.getDisplayedMnemonic();
                     putOnRelease(inputMap, dka, BasicLookAndFeel
                             .getFocusAcceleratorKeyMask());
    +                putOnRelease(inputMap, dka, BasicLookAndFeel
    +                        .getFocusAcceleratorKeyMask() |
    +                        InputEvent.ALT_GRAPH_DOWN_MASK);
                     // Need this when the sticky keys are enabled
                     putOnRelease(inputMap, dka, 0);
                     // Need this if ALT is released before the accelerator
                     putOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                     label.requestFocus();

    @@ -537,10 +544,13 @@
                         if (inputMap != null) {
                             // inputMap should never be null.
                             int dka = label.getDisplayedMnemonic();
                             removeOnRelease(inputMap, dka, BasicLookAndFeel
                                     .getFocusAcceleratorKeyMask());
    +                        removeOnRelease(inputMap, dka, BasicLookAndFeel
    +                                .getFocusAcceleratorKeyMask() |
    +                                InputEvent.ALT_GRAPH_DOWN_MASK);
                             removeOnRelease(inputMap, dka, 0);
                             removeOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                         }
                         inputMap = SwingUtilities.getUIInputMap(label,
                                 JComponent.WHEN_IN_FOCUSED_WINDOW);

    @@ -553,10 +563,13 @@
                         if (isCommand) {
                             putOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                         } else {
                             putOnRelease(inputMap, dka, BasicLookAndFeel
                                     .getFocusAcceleratorKeyMask());
    +                        putOnRelease(inputMap, dka, BasicLookAndFeel
    +                                .getFocusAcceleratorKeyMask() |
    +                                InputEvent.ALT_GRAPH_DOWN_MASK);
                             // Need this when the sticky keys are enabled
                             putOnRelease(inputMap, dka, 0);
                         }
                         if (labelFor instanceof Container &&
                                 ((Container) labelFor).isFocusCycleRoot()) {

    @@ -570,10 +583,13 @@
                         int dka = label.getDisplayedMnemonic();
                         if (inputMap != null) {
                             if (isCommand) {
                                 removeOnRelease(inputMap, dka, BasicLookAndFeel
                                         .getFocusAcceleratorKeyMask());
    +                            removeOnRelease(inputMap, dka, BasicLookAndFeel
    +                                    .getFocusAcceleratorKeyMask() |
    +                                    InputEvent.ALT_GRAPH_DOWN_MASK);
                                 removeOnRelease(inputMap, dka, 0);
                             } else {
                                 removeOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                             }
                         }

< prev index next >