IDEA-121475 Row height in "Environment Variables" too low
authorVassiliy <vassiliy.kudryashov@jetbrains.com>
Tue, 20 May 2014 15:42:20 +0000 (19:42 +0400)
committerVassiliy <vassiliy.kudryashov@jetbrains.com>
Tue, 20 May 2014 15:43:22 +0000 (19:43 +0400)
platform/platform-api/src/com/intellij/ui/table/JBTable.java

index f8e91cb5cebfb037b268ccf123355ca48908120b..a80a1e6ca89f8fb21d00eb014946cc2460309523 100644 (file)
@@ -492,11 +492,29 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
       if (isTypeAhead) {
         JTableCellEditorHelper.typeAhead(this, e, row, column);
       }
+      setRowHeight(row, editorComp.getPreferredSize().height);
       return true;
     }
     return false;
   }
 
+  @NotNull
+  @Override
+  public Rectangle getCellRect(int row, int column, boolean includeSpacing) {
+    Rectangle rect = super.getCellRect(row, column, includeSpacing);
+    if (getRowHeight() != getRowHeight(row) && row < getRowCount() && getEditingRow() == row && row > 0) {
+      rect.y = row * getRowHeight();
+      if (includeSpacing) rect.y += Math.min(getRowMargin(), rect.height);
+    }
+    return rect;
+  }
+
+  @Override
+  public void editingStopped(ChangeEvent e) {
+    setRowHeight(editingRow, getRowHeight());
+    super.editingStopped(e);
+  }
+
   private static boolean isTableDecorationSupported() {
     return UIUtil.isUnderAlloyLookAndFeel()
            || UIUtil.isUnderNativeMacLookAndFeel()