You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/10/20 21:47:00 UTC
svn commit: r827768 -
/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
Author: gbrown
Date: Tue Oct 20 19:47:00 2009
New Revision: 827768
URL: http://svn.apache.org/viewvc?rev=827768&view=rev
Log:
Validate document view before getting its size in TextAreaSkin#getPreferredHeight().
Modified:
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=827768&r1=827767&r2=827768&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Tue Oct 20 19:47:00 2009
@@ -586,7 +586,6 @@
setSize(width, height);
super.validate();
- invalidateComponent();
}
}
@@ -1111,14 +1110,7 @@
@Override
public int getPreferredWidth(int height) {
- int preferredWidth;
- if (documentView == null) {
- preferredWidth = 0;
- } else {
- preferredWidth = documentView.getWidth() + margin.left + margin.right;
- }
-
- return preferredWidth;
+ throw new UnsupportedOperationException();
}
@Override
@@ -1127,6 +1119,9 @@
if (documentView == null) {
preferredHeight = 0;
} else {
+ documentView.setBreakWidth(Math.max(width - (margin.left + margin.right), 0));
+ documentView.validate();
+
preferredHeight = documentView.getHeight() + margin.top + margin.bottom;
}
@@ -1135,19 +1130,7 @@
@Override
public Dimensions getPreferredSize() {
- int preferredWidth;
- int preferredHeight;
-
- if (documentView == null) {
- preferredWidth = 0;
- preferredHeight = 0;
- } else {
- Dimensions preferredSize = documentView.getSize();
- preferredWidth = preferredSize.width + (margin.left + margin.right);
- preferredHeight = preferredSize.height + (margin.top + margin.bottom);
- }
-
- return new Dimensions(preferredWidth, preferredHeight);
+ throw new UnsupportedOperationException();
}
@Override