Class ElementFactory
java.lang.Object
org.eclipse.birt.report.model.api.ElementFactory
Creates a new report elements and returns handles to it. Use this to create
elements. After creating an element, add it to the design using the
add
method in the SlotHandle
class. Obtain an instance of
this class by calling the getElementFactory
method on any
element handle.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.eclipse.birt.report.model.core.Module
The module. -
Constructor Summary
ConstructorsConstructorDescriptionElementFactory
(org.eclipse.birt.report.model.core.Module module) Constructs a element factory with the given module. -
Method Summary
Modifier and TypeMethodDescriptionprotected DesignElementHandle
createElementFrom
(String name, DesignElementHandle baseElement) Creates one new element based on the given element.Deprecated.newAutoText
(String name) Creates a new specialfield item.Creates a new parameter group element.newCell()
Creates a new cell element.Creates a data group element.newDataItem
(String name) Creates a new data item.newDerivedDataSet
(String name, String extensionID) Creates a new derived data set.Creates a new dynamic filter parameter element.newElement
(String elementTypeName, String name) Creates a design element specified by the element type name.newElementFrom
(DesignElementHandle baseElement, String name) Creates one new element based on the given element.newExtendedItem
(String name, String extensionName) Creates a new extended item.Creates a filter condition element handle.newFreeForm
(String name) Creates a new free-form item.newGraphicMasterPage
(String name) Creates a new graphic master page element.newGridItem
(String name) Creates a new grid item.newGridItem
(String name, int columnNum, int rowNum) Creates a new grid item with pre-defined columns and rows.Creates a new image item.newJointDataSet
(String name) Creates a new joint data set.Creates a new label item.newLineItem
(String name) Creates a new line item.Creates a new list item.Creates a new list group element.Creates a member value handle.Creates a multiple view element handle.newOdaCube
(String name) Creates a new cube element.newOdaDataSet
(String name) Deprecated.newOdaDataSet
(String name, String extensionID) Creates a new oda data set.newOdaDataSource
(String name) Deprecated.seenewOdaDataSource( String name, String extensionID )
newOdaDataSource
(String name, String extensionID) Creates a new oda data source.newOdaDimension
(String name) Creates a new dimension element.newOdaHierarchy
(String name) Creates a new hierarchy element.newOdaLevel
(String name) Deprecated.newOdaLevel
(DimensionHandle dimensionHandle, String name) Creates a new oda level handle.newOdaMeasure
(String name) Creates a new measure element.newOdaMeasureGroup
(String name) Creates a new measure group.newParameterGroup
(String name) Creates a new parameter group element.newRectangle
(String name) Creates a new rectangle.newReportItemTheme
(String name) Creates a new report item theme element.newScalarParameter
(String name) Creates a new scalar parameter element.newScriptDataSet
(String name) Creates a new script data set.newScriptDataSource
(String name) Creates a new script data source.newSimpleMasterPage
(String name) Creates a new simple master page element.Creates a sort element handle.Creates a new style element.newStyle
(AbstractThemeHandle theme, String name) Creates a new style element, and the style element is supposed to be adding to some theme in Library.Creates a new column element.Creates a new table group element.newTableItem
(String name) Creates a new table item.newTableItem
(String name, int columnNum) Creates a new table item with the given name and given column number.newTableItem
(String name, int columnNum, int headerRow, int detailRow, int footerRow) Creates a new table item with the given name and given column number.Creates a new row element.newTableRow
(int cellNum) Creates a new table row, filled the row with the given number of cells.newTabularCube
(String name) Creates a new cube element.newTabularDimension
(String name) Creates a new dimension element.newTabularHierarchy
(String name) Creates a new hierarchy element.newTabularLevel
(String name) Deprecated.newTabularLevel
(DimensionHandle dimensionHandle, String name) Creates a new level element within the given dimension handle.newTabularMeasure
(String name) Creates a new measure element.newTabularMeasureGroup
(String name) Creates a new measure group.newTextData
(String name) Creates a new multi line data item.newTextItem
(String name) Creates a new text item.Creates a new theme element.Deprecated.Deprecated.replaced by newVariableElement( String variableName )newVariableElement
(String variableName) Creates a variable element and set the variable name.
-
Field Details
-
module
protected final org.eclipse.birt.report.model.core.Module moduleThe module.
-
-
Constructor Details
-
ElementFactory
public ElementFactory(org.eclipse.birt.report.model.core.Module module) Constructs a element factory with the given module.- Parameters:
module
- the module
-
-
Method Details
-
newElement
Creates a design element specified by the element type name. Element type names are defined in rom.def or extension elements. They are managed by the meta-data system.- Parameters:
elementTypeName
- the element type namename
- the optional element name- Returns:
- design element,
null
returned if the element definition name is not a valid element type name.
-
newFreeForm
Creates a new free-form item.- Parameters:
name
- the optional free-form name. Can benull
.- Returns:
- a handle to the free-form
-
newDataItem
Creates a new data item.- Parameters:
name
- the optional data item name. Can benull
.- Returns:
- a handle to the data item
-
newLabel
Creates a new label item.- Parameters:
name
- the optional label name. Can benull
.- Returns:
- a handle to the label
-
newAutoText
Creates a new specialfield item.- Parameters:
name
- the optional data item name. Can benull
.- Returns:
- a handle to the data item
-
newImage
Creates a new image item.- Parameters:
name
- the optional image name. Can benull
.- Returns:
- a handle to the image
-
newListGroup
Creates a new list group element. List groups cannot have a name.- Returns:
- a handle to the list group
-
newList
Creates a new list item.- Parameters:
name
- the optional list name. Can benull
.- Returns:
- a handle to the list
-
newGraphicMasterPage
Creates a new graphic master page element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required graphic master page name- Returns:
- a handle to the graphic master page
-
newSimpleMasterPage
Creates a new simple master page element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the requirement simple master page name- Returns:
- a handle to the simple master page.
-
newParameterGroup
Creates a new parameter group element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the optional parameter group name. Can benull
.- Returns:
- a handle to the parameter group
-
newCascadingParameterGroup
Creates a new parameter group element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the optional parameter group name. Can benull
.- Returns:
- a handle to the parameter group
-
newScalarParameter
Creates a new scalar parameter element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required scalar parameter name- Returns:
- a handle to the scalar parameter
-
newDynamicFilterParameter
Creates a new dynamic filter parameter element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required dynamic filter parameter name- Returns:
- a handle to the dynamic filter parameter
-
newStyle
Creates a new style element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required style name- Returns:
- a handle to the style
-
newStyle
Creates a new style element, and the style element is supposed to be adding to some theme in Library. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
theme
- the theme to add the stylename
- the required style name- Returns:
- a handle to the style
-
newTextItem
Creates a new text item.- Parameters:
name
- the optional text item name. Can benull
.- Returns:
- a handle to the text item
-
newTableItem
Creates a new table item.- Parameters:
name
- the optional table item name. Can benull
.- Returns:
- a handle to the table item
-
newTableItem
Creates a new table item with the given name and given column number. The table will have one row for each band(header, footer, detail). Each row in band will be filled with cells, number of cells is equal to the specified column number.It has the same effect by calling:
newTableItem( name, columnNum, 1, 1, 1 )
.- Parameters:
name
- the optional table item namecolumnNum
- column number of the table, if it is less than 0, then column won't be defined for the table at this stage.- Returns:
- A handle to the table item.
- See Also:
-
newTableItem
public TableHandle newTableItem(String name, int columnNum, int headerRow, int detailRow, int footerRow) Creates a new table item with the given name and given column number. The table will have given number of rows for each band(header, footer, detail). Each row in band will be filled with cells, number of cells is equal to the specified column number.- Parameters:
name
- the optional table item namecolumnNum
- column number of the table, if it is less than 0, then column won't be defined for the table at this stage.headerRow
- number of rows that will be added for header band. If it is less than 0, none row will be added to header band.detailRow
- number of rows that will be added for detail band. If it is less than 0, none row will be added to detail band.footerRow
- number of rows that will be added for footer band. If it is less than 0, none row will be added to footer band.- Returns:
- A handle to the table item.
-
newTableGroup
Creates a new table group element. Table groups cannot have a name.- Returns:
- a handle to the table group
-
newTableColumn
Creates a new column element. Columns cannot have a name.- Returns:
- a handle to the column
-
newTableRow
Creates a new row element. Rows cannot have a name.- Returns:
- a handle to the row
-
newTableRow
Creates a new table row, filled the row with the given number of cells.- Parameters:
cellNum
- Number of cells to be added to the row.- Returns:
- a new table row.
-
newCell
Creates a new cell element. Cells cannot have a name.- Returns:
- a handle to the cell
-
newGridItem
Creates a new grid item.- Parameters:
name
- the optional grid item name. Can benull
.- Returns:
- a handle to the grid item
-
newGridItem
Creates a new grid item with pre-defined columns and rows.- Parameters:
name
- the optional grid item name.columnNum
- column number of the grid. If it is less than 0, none column will be added.rowNum
- row number of the grid. If it is less than 0, none row will be added.- Returns:
- a handle to the grid item
-
newLineItem
Creates a new line item.- Parameters:
name
- the optional line item name. Can benull
.- Returns:
- a handle to the line item
-
newRectangle
Creates a new rectangle.- Parameters:
name
- the optional rectangle name. Can benull
.- Returns:
- a handle to rectangle
-
newTextData
Creates a new multi line data item.- Parameters:
name
- the optional multi line data name. Can benull
.- Returns:
- a handle to multi line data item
-
newExtendedItem
Creates a new extended item.- Parameters:
name
- the optional extended item name. Can benull
.extensionName
- the required extension name- Returns:
- a handle to extended item, return
null
if the definition with the given extension name is not found
-
newScriptDataSource
Creates a new script data source.- Parameters:
name
- the required script data source name.- Returns:
- a handle to script data source
-
newScriptDataSet
Creates a new script data set. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required script data set name.- Returns:
- a handle to script data set
-
newOdaDataSource
Deprecated.seenewOdaDataSource( String name, String extensionID )
Creates a new oda data source. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required oda data source name.- Returns:
- a handle to oda data source
-
newOdaDataSource
Creates a new oda data source. The name is required. If thename
is null, we will make a unique name for it.TheextensionID
is used to find the extension definition.If the extension ID is not given, the oda data source will be created without extension. If the unknown extension ID is given,null
will be returned.- Parameters:
name
- the required oda data source name.extensionID
- the extension ID- Returns:
- a handle to oda data source
-
newOdaDataSet
Deprecated.seenewOdaDataSet( String name, String extensionID )
Creates a new oda data set. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required oda data set name.- Returns:
- a handle to oda data set
-
newJointDataSet
Creates a new joint data set. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required joint data set name.- Returns:
- a handle to joint data set
-
newOdaDataSet
Creates a new oda data set. The name is required. If thename
is null, we will make a unique name for it. TheextensionID
is used to find the extension definition.If the extension ID is not given, the oda data source will be created without extension. If the unknown extension ID is given,null
will be returned.- Parameters:
name
- the required oda data set name.extensionID
- the extension ID- Returns:
- a handle to oda data set
-
newDerivedDataSet
Creates a new derived data set. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the required derived data set name.extensionID
- extension id- Returns:
- a handle to derived data set
-
newElementFrom
public DesignElementHandle newElementFrom(DesignElementHandle baseElement, String name) throws ExtendsException Creates one new element based on the given element. The new element will extends the given one. The element must be extendable.- Parameters:
baseElement
- the base element.name
- the optional new element name- Returns:
- the handle to the new element.
- Throws:
ExtendsException
- if the the base element is in a library that is not included in this module, or if the "extends" relationship is illegal
-
createElementFrom
protected DesignElementHandle createElementFrom(String name, DesignElementHandle baseElement) throws ExtendsException Creates one new element based on the given element. The new element will extends the given one. The element must be extendable.- Parameters:
name
- the optional new element namebaseElement
- the base element- Returns:
- the handle to the new element.
- Throws:
ExtendsException
- if the "extends" relationship is illegal
-
newTheme
Creates a new theme element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the theme item name.- Returns:
- a handle to the theme item
-
newReportItemTheme
Creates a new report item theme element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the report item theme name.- Returns:
- a handle to the theme item
-
newTabularCube
Creates a new cube element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the cube element name.- Returns:
- a handle to the cube element
-
newTabularDimension
Creates a new dimension element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the dimension name- Returns:
- a handle to the dimension element
-
newTabularHierarchy
Creates a new hierarchy element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- hierarchy name- Returns:
- a handle to the hierarchy element
-
newTabularLevel
Deprecated.Creates a new level element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the level name- Returns:
- a handle to the level element
-
newTabularLevel
Creates a new level element within the given dimension handle. The name is required. If thename
is null, we will make a unique name with the given dimension scope for it.- Parameters:
dimensionHandle
- the dimension handle where the level will be insertedname
- the level name- Returns:
- a handle to the level element
-
newTabularMeasure
Creates a new measure element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the measure name- Returns:
- a handle to the measure element
-
newTabularMeasureGroup
Creates a new measure group.- Parameters:
name
- the optional measure group name.- Returns:
- the measure group element
-
newAccessControl
Deprecated.Creates an access control element.- Returns:
- the access control element
-
newValueAccessControl
Deprecated.Creates a value access control element.- Returns:
- the value access control element
-
newOdaCube
Creates a new cube element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the cube element name.- Returns:
- a handle to the cube element
-
newOdaDimension
Creates a new dimension element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the dimension name- Returns:
- a handle to the dimension element
-
newOdaHierarchy
Creates a new hierarchy element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- hierarchy name- Returns:
- a handle to the hierarchy element
-
newOdaLevel
Deprecated.Creates a new level element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the level name- Returns:
- a handle to the level element
-
newOdaLevel
Creates a new oda level handle. The name is required. If given name is null, we will make a unique name within the dimension scope for it.- Parameters:
dimensionHandle
- the dimension handle where the level will be insertedname
- the level name- Returns:
- a handle to the level element
-
newOdaMeasure
Creates a new measure element. The name is required. If thename
is null, we will make a unique name for it.- Parameters:
name
- the measure name- Returns:
- a handle to the measure element
-
newOdaMeasureGroup
Creates a new measure group.- Parameters:
name
- the optional measure group name.- Returns:
- the measure group element
-
newMemberValue
Creates a member value handle.- Returns:
- a handle to the member value
-
newSortElement
Creates a sort element handle.- Returns:
- a handle to the sort element
-
newFilterConditionElement
Creates a filter condition element handle.- Returns:
- a handle to the filter condition element
-
newMultiView
Creates a multiple view element handle.- Returns:
- a handle to the multiple view element
-
newVariableElement
Deprecated.replaced by newVariableElement( String variableName )Creates a variable element.- Returns:
- the variable element
-
newVariableElement
Creates a variable element and set the variable name.- Parameters:
variableName
- the variable name.- Returns:
- the variable element handle.
-
newDataGroup
Creates a data group element.- Returns:
- the generated data group element
-
newOdaDataSet( String name, String extensionID )