@Override
  public Dimension getPreferredSize() {
    if (isPreferredSizeSet()) {
      return super.getPreferredSize();
    }

    Editor editor = getEditor(true);
    boolean toReleaseEditor = false;
    if (editor == null && myEnsureWillComputePreferredSize) {
      myEnsureWillComputePreferredSize = false;
      editor = initEditorInner();
      toReleaseEditor = true;
    }

    Dimension size = JBUI.size(100, 10);
    if (editor != null) {
      Dimension preferredSize = editor.getComponent().getPreferredSize();

      JBInsets.addTo(preferredSize, getInsets());
      size = preferredSize;
    }
    else if (myPassivePreferredSize != null) {
      size = myPassivePreferredSize;
    }

    if (toReleaseEditor) {
      releaseEditorNow();
      myPassivePreferredSize = size;
    }

    if (myPreferredWidth != -1) {
      size.width = myPreferredWidth;
    }
    return size;
  }
@Override
  public Dimension getPreferredSize()