Class LayoutUtil
- java.lang.Object
-
- org.eclipse.birt.report.model.api.elements.table.LayoutUtil
-
public class LayoutUtil extends java.lang.Object
The utility class forLayoutTable
.
-
-
Constructor Summary
Constructors Constructor Description LayoutUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.birt.report.model.elements.ReportItem
getCompoundContainer(IDesignElement element)
Returns a nearestTableItem/GridItem
container forTableRow
,TableGroup
andTableItem
if applicable.static int
getEffectiveColumnSpan(CellHandle cell)
Returns the effective column span of the given cell.static int
getEffectiveRowSpan(CellHandle cell)
Returns the effective row span of the given cell.protected static java.util.List
getFlattenedLayoutSlots(LayoutTable table)
Returns flattern slots of the layout table regardless GROUP/Table slots.protected static int
getRowCount(LayoutTable table)
Calculates the row number in the table.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.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.
-
-
-
Method Detail
-
getRowCount
protected static int getRowCount(LayoutTable table)
Calculates the row number in the table.- Parameters:
table
- the layout table- Returns:
- the row number in the table
-
getFlattenedLayoutSlots
protected static java.util.List getFlattenedLayoutSlots(LayoutTable table)
Returns flattern slots of the layout table regardless GROUP/Table slots.- Parameters:
table
- the layout table- Returns:
- a list containing flattern slots
-
getEffectiveColumnSpan
public static int getEffectiveColumnSpan(CellHandle cell)
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
public static int getEffectiveRowSpan(CellHandle cell)
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/GridItem
container forTableRow
,TableGroup
andTableItem
if applicable.If
TableRow
is in theGridItem
, returnnull
.- Parameters:
element
- the element where the search begins- Returns:
- a nearest
TableItem/GridItem
container
-
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:
true
if 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:
true
if the table is valid. Otherwisefalse
.
-
-