protected void installKeyboardActions() {
    InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(desktop, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
    }
    inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(
          desktop, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
    }

    LazyActionMap.installLazyActionMap(desktop, BasicDesktopPaneUI.class, "DesktopPane.actionMap");
    registerKeyboardActions();
  }
Ejemplo n.º 2
0
  protected void installKeyboardActions() {
    InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW, map);

    LazyActionMap.installLazyActionMap(optionPane, BasicOptionPaneUI.class, "OptionPane.actionMap");
  }
Ejemplo n.º 3
0
 protected void uninstallListeners(JFileChooser fc) {
   if (propertyChangeListener != null) {
     fc.removePropertyChangeListener(propertyChangeListener);
   }
   fc.removePropertyChangeListener(getModel());
   SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
   SwingUtilities.replaceUIActionMap(fc, null);
 }
Ejemplo n.º 4
0
  protected void installListeners(JFileChooser fc) {
    propertyChangeListener = createPropertyChangeListener(fc);
    if (propertyChangeListener != null) {
      fc.addPropertyChangeListener(propertyChangeListener);
    }
    fc.addPropertyChangeListener(getModel());

    InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    SwingUtilities.replaceUIInputMap(fc, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
    ActionMap actionMap = getActionMap();
    SwingUtilities.replaceUIActionMap(fc, actionMap);
  }
Ejemplo n.º 5
0
 protected void uninstallKeyboardActions() {
   SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW, null);
   SwingUtilities.replaceUIActionMap(optionPane, null);
 }
 protected void installKeyboardActions() {
   ActionMap map = getActionMap();
   SwingUtilities.replaceUIActionMap(grid, map);
   InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
   SwingUtilities.replaceUIInputMap(grid, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
 }
 protected void uninstallKeyboardActions() {
   unregisterKeyboardActions();
   SwingUtilities.replaceUIInputMap(desktop, JComponent.WHEN_IN_FOCUSED_WINDOW, null);
   SwingUtilities.replaceUIInputMap(desktop, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
   SwingUtilities.replaceUIActionMap(desktop, null);
 }