org.eclipse.birt.report.model.api.elements.table
Class LayoutUtil

java.lang.Object
  extended by org.eclipse.birt.report.model.api.elements.table.LayoutUtil

public class LayoutUtil
extends java.lang.Object

The utility class for LayoutTable.


Constructor Summary
LayoutUtil()
           
 
Method Summary
static org.eclipse.birt.report.model.elements.ReportItem getCompoundContainer(IDesignElement element)
          Returns a nearest TableItem/GridItem container for TableRow, TableGroup and TableItem 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutUtil

public LayoutUtil()
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 nearest TableItem/GridItem container for TableRow, TableGroup and TableItem if applicable.

If TableRow is in the GridItem, return null.

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:

Parameters:
grid - the table
module - the root of the table
Returns:
true if the table is valid. Otherwise false.

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:

Parameters:
table - the table
module - the root of the table
Returns:
true if the table is valid. Otherwise false.


Copyright © 2008 Actuate Corp. All rights reserved.