Class LayoutUtil
java.lang.Object
org.eclipse.birt.report.model.api.elements.table.LayoutUtil
The utility class for
LayoutTable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.birt.report.model.elements.ReportItemgetCompoundContainer(IDesignElement element) Returns a nearestTableItem/GridItemcontainer forTableRow,TableGroupandTableItemif applicable.static intReturns the effective column span of the given cell.static intReturns the effective row span of the given cell.protected static ListReturns flattern slots of the layout table regardless GROUP/Table slots.protected static intgetRowCount(LayoutTable table) Calculates the row number in the table.static booleanisValidLayout(org.eclipse.birt.report.model.elements.GridItem grid, org.eclipse.birt.report.model.core.Module module) Checks whether the layout grid is valid or not.static booleanisValidLayout(org.eclipse.birt.report.model.elements.TableItem table, org.eclipse.birt.report.model.core.Module module) Checks whether the layout table is valid or not.
-
Constructor Details
-
LayoutUtil
public LayoutUtil()
-
-
Method Details
-
getRowCount
Calculates the row number in the table.- Parameters:
table- the layout table- Returns:
- the row number in the table
-
getFlattenedLayoutSlots
Returns flattern slots of the layout table regardless GROUP/Table slots.- Parameters:
table- the layout table- Returns:
- a list containing flattern slots
-
getEffectiveColumnSpan
Returns the effective column span of the given cell.- Parameters:
cell- the cell to find- Returns:
- the 1-based effective column span of the given cell. 0 means the cell is in the table element but it do not show in the layout.
-
getEffectiveRowSpan
Returns the effective row span of the given cell.- Parameters:
cell- the cell to find- Returns:
- the 1-based effective row span of the given cell. 0 means the cell is in the table element but it do not show in the layout.
-
getCompoundContainer
public static org.eclipse.birt.report.model.elements.ReportItem getCompoundContainer(IDesignElement element) Returns a nearestTableItem/GridItemcontainer forTableRow,TableGroupandTableItemif applicable.If
TableRowis in theGridItem, returnnull.- Parameters:
element- the element where the search begins- Returns:
- a nearest
TableItem/GridItemcontainer
-
isValidLayout
public static boolean isValidLayout(org.eclipse.birt.report.model.elements.GridItem grid, org.eclipse.birt.report.model.core.Module module) Checks whether the layout grid is valid or not. The invalid grid has following cases:- column count bigger than zero.
- no repeat value bigger than one in column slot
- Parameters:
grid- the tablemodule- the root of the table- Returns:
trueif the table is valid. Otherwisefalse.
-
isValidLayout
public static boolean isValidLayout(org.eclipse.birt.report.model.elements.TableItem table, org.eclipse.birt.report.model.core.Module module) Checks whether the layout table is valid or not. The invalid table has following cases:- has overlapped area.
- column counts in rows are different.
- empty rows and columns.
- Parameters:
table- the tablemodule- the root of the table- Returns:
trueif the table is valid. Otherwisefalse.
-