litesoft
@ 948
litesoft / trunk / GWT_Sandbox / FormEngine / src / com / temp / client / foundation / util / GridUtils.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
package com.temp.client.foundation.util; import com.google.gwt.user.client.ui.*; import com.google.gwt.user.client.ui.HTMLTable.*; import com.google.gwt.user.client.ui.HasHorizontalAlignment.*; import com.google.gwt.user.client.ui.HasVerticalAlignment.*; public class GridUtils { public static void setAllCellsAlignment( Grid grid, VerticalAlignmentConstant alignment ) { CellFormatter formatter = grid.getCellFormatter(); for ( int row = 0; row < grid.getRowCount(); row++ ) { int cells = grid.getCellCount( row ); for ( int cell = 0; cell < cells; cell++ ) { formatter.setVerticalAlignment( row, cell, alignment ); } } } public static void setAllCellsAlignment( Grid grid, HorizontalAlignmentConstant alignment ) { CellFormatter formatter = grid.getCellFormatter(); for ( int row = 0; row < grid.getRowCount(); row++ ) { int cells = grid.getCellCount( row ); for ( int cell = 0; cell < cells; cell++ ) { formatter.setHorizontalAlignment( row, cell, alignment ); } } } } |