* | | | 5 4
* | | |
* |__|_____| 6
*/
public void testReduceRowComplex() {
Grid grid = new Grid();
// Configure Grid Content
grid.setSize(3);
for (int i = 0; i < 12; ++i) {
Label label = new Label(Integer.toString(i));
if (i == 3 || i == 4 || i == 5 || i == 6 || i == 8 || i == 10 || i == 11) {
GridLayoutData layoutData = new GridLayoutData();
layoutData.setRowSpan(2);
if (i == 11) {
layoutData.setColumnSpan(2);
}
label.setLayoutData(layoutData);
}
grid.add(label);
}
// Set Row Sizes
grid.setRowHeight(0, new Extent(1));
grid.setRowHeight(1, new Extent(2));
grid.setRowHeight(2, new Extent(4));
grid.setRowHeight(3, new Extent(8));
grid.setRowHeight(4, new Extent(16));
grid.setRowHeight(5, new Extent(32));
grid.setRowHeight(6, new Extent(64));
GridProcessor gridProcessor = new GridProcessor(grid);
// Verify Grid size is correct.
assertEquals(3, gridProcessor.getColumnCount());