if (child != uiInputMap)
  public static void replaceUIInputMap(JComponent component,                                        int condition,                                        InputMap uiInputMap)  {    InputMap child = component.getInputMap(condition);    if (child == null)      component.setInputMap(condition, uiInputMap);    else      {        InputMap parent = child.getParent();        while (parent != null && !(parent instanceof InputMapUIResource))          {            child = parent;            parent = parent.getParent();          }          child.setParent(uiInputMap);      }  }