コード例 #1
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);
 }
コード例 #2
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);
  }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }