DesktopTextArea should have rows = 5 by default #PL-5028

This commit is contained in:
Gleb Gorelov 2015-03-13 12:17:41 +00:00
parent efecd0b328
commit 2f1bcc8b38

View File

@ -26,6 +26,10 @@ public class DesktopTextArea extends DesktopAbstractTextField<JTextArea> impleme
protected JComponent composition;
public DesktopTextArea() {
setRows(5);
}
@Override
protected JTextArea createTextComponentImpl() {
final JTextArea impl = new TextAreaFlushableField();
@ -98,7 +102,7 @@ public class DesktopTextArea extends DesktopAbstractTextField<JTextArea> impleme
impl.setRows(rows);
int minHeight = impl.getPreferredSize().height;
int minWidth = impl.getMinimumSize().width;
int minWidth = impl.getPreferredSize().width;
Insets insets = impl.getInsets();
minWidth += insets.left + insets.right;
@ -117,7 +121,7 @@ public class DesktopTextArea extends DesktopAbstractTextField<JTextArea> impleme
impl.setColumns(columns);
if (columns > 1) {
int minHeight = impl.getMinimumSize().height;
int minHeight = impl.getPreferredSize().height;
int minWidth = impl.getPreferredSize().width;
Insets insets = impl.getInsets();
@ -126,7 +130,7 @@ public class DesktopTextArea extends DesktopAbstractTextField<JTextArea> impleme
composition.setMinimumSize(new Dimension(minWidth, minHeight));
} else {
int minHeight = impl.getMinimumSize().height;
int minHeight = impl.getPreferredSize().height;
Insets insets = impl.getInsets();
minHeight += insets.bottom + insets.top;