@Override
  protected boolean preprocessEventForTextField(KeyEvent event) {
    if (!myDelegatingNow) {
      KeyStroke stroke = KeyStroke.getKeyStrokeForEvent(event);
      String strokeString = stroke.toString();
      if ("pressed ESCAPE".equals(strokeString) && !getText().isEmpty()) {
        setText(""); // reset filter on ESC
        return true;
      }
      if (getTextEditor().isFocusOwner()) {
        try {
          myDelegatingNow = true;
          int code = stroke.getKeyCode();
          boolean treeNavigation = stroke.getModifiers() == 0 && (code == KeyEvent.VK_UP || code == KeyEvent.VK_DOWN);
          if (treeNavigation || !hasAction(stroke, getTextEditor().getInputMap())) {
            onTextKeyEvent(event);
            return true;
          }
        }
        finally {
          myDelegatingNow = false;
        }
      }
    }
    return false;
  }
@Override
  protected boolean preprocessEventForTextField(KeyEvent event)