summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Dukadinov2012-03-23 11:33:57 (EDT)
committerJordan Dukadinov2012-04-04 09:01:18 (EDT)
commitb65a45a4e5037132bfc6a96ce9777a1d683fd5a7 (patch)
tree71a327e1ecd9439b6f1493a25fdfbde14907f159
parent3d98056435f70140e11250ca3259c969189e0168 (diff)
downloadorg.eclipse.riena-b65a45a4e5037132bfc6a96ce9777a1d683fd5a7.zip
org.eclipse.riena-b65a45a4e5037132bfc6a96ce9777a1d683fd5a7.tar.gz
org.eclipse.riena-b65a45a4e5037132bfc6a96ce9777a1d683fd5a7.tar.bz2
Fixed wrong column width calculation - bug 301682
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java2
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/ColumnUtils.java6
2 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
index 925de32..cf4c8b9 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
@@ -100,7 +100,7 @@ public class TableRidgetTest extends AbstractTableListRidgetTest {
ridget.bindToModel(manager, "persons", Person.class, columns3, null); //$NON-NLS-1$
ridget.updateFromModel();
- ridget.setColumnWidths(new Object[] { new ColumnWeightData(1), new ColumnWeightData(2), new ColumnWeightData(3) });
+ ridget.setColumnWidths(new Object[] { new ColumnWeightData(1, 1, true), new ColumnWeightData(2, 1, true), new ColumnWeightData(3, 1, true) });
assertTrue("column 0 should be smaller than column 1", table.getColumn(0).getWidth() < table.getColumn(1).getWidth()); //$NON-NLS-1$
assertTrue("column 1 should be smaller than column 2", table.getColumn(1).getWidth() < table.getColumn(2).getWidth()); //$NON-NLS-1$
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/ColumnUtils.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/ColumnUtils.java
index d2ffb3e..eac0204 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/ColumnUtils.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/ColumnUtils.java
@@ -182,6 +182,12 @@ public final class ColumnUtils {
// compute remaining width and total weight; for each column: apply
// the largest value of either the relative width or the minimum width
int widthRemaining = control.getClientArea().width;
+
+ // Workaround for Bug 301682
+ if (widthRemaining == 0) {
+ parent.layout();
+ widthRemaining = control.getClientArea().width;
+ }
int totalWeights = 0;
for (int index = 0; index < expectedCols; index++) {
final ColumnLayoutData data = columnData[index];