Package org.eclipse.birt.report.model.api

# Class GroupHandle

java.lang.Object
org.eclipse.birt.report.model.api.DesignElementHandle
org.eclipse.birt.report.model.api.ReportElementHandle
org.eclipse.birt.report.model.api.GroupHandle

All Implemented Interfaces:
  `org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel`, `org.eclipse.birt.report.model.elements.interfaces.IGroupElementModel`

Direct Known Subclasses:
  `ListGroupHandle`, `TableGroupHandle`

public abstract class GroupHandle extends ReportElementHandle implements org.eclipse.birt.report.model.elements.interfaces.IGroupElementModel
Represents both list and table groups in the design. Groups provide a way of showing common headings for a group of related rows.

A group is defined by a group key. The key is a column from the query. If the group key is a time field then user often want to group on an interval such as month or quarter.

See Also:
  - `GroupElement`
  - `SlotHandle`

## Field Summary

### Fields inherited from class org.eclipse.birt.report.model.api.ReportElementHandle

`element`

### Fields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle

`module`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel

`COMMENTS_PROP, CUSTOM_XML_PROP, DISPLAY_NAME_ID_PROP, DISPLAY_NAME_PROP, EVENT_HANDLER_CLASS_PROP, EXTENDS_PROP, FULL_LABEL, ID_SUFFIX, NAME_PROP, NEW_HANDLER_ON_EACH_EVENT_PROP, NO_SLOT, PROPERTY_MASKS_PROP, REF_TEMPLATE_PARAMETER_PROP, SHORT_LABEL, USER_LABEL, USER_PROPERTIES_PROP, VIEW_ACTION_PROP`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IGroupElementModel

`ACL_EXPRESSION_PROP, BOOKMARK_DISPLAY_NAME_PROP, BOOKMARK_PROP, BOUND_DATA_COLUMNS_PROP, CASCADE_ACL_PROP, FILTER_PROP, FOOTER_SLOT, GROUP_NAME_PROP, GROUP_START_PROP, HEADER_SLOT, HIDE_DETAIL_PROP, INTERVAL_BASE_PROP, INTERVAL_PROP, INTERVAL_RANGE_PROP, KEY_EXPR_PROP, ON_CREATE_METHOD, ON_PAGE_BREAK_METHOD, ON_PREPARE_METHOD, ON_RENDER_METHOD, REPEAT_HEADER_PROP, SHOW_DETAIL_FILTER_PROP, SLOT_COUNT, SORT_DIRECTION_PROP, SORT_PROP, SORT_TYPE_PROP, TOC_PROP`

## Constructor Summary

Constructors
Constructor
Description
`GroupHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)`
Constructs a group handle with the given design and the design element.

## Method Summary

Modifier and Type
Method
Description
`ComputedColumnHandle`
`addColumnBinding(ComputedColumn addColumn, boolean inForce)`
Deprecated.
since BIRT 2.1 RC2
`TOCHandle`
`addTOC(String expression)`
Adds toc structure.
`TOCHandle`
`addTOC(TOC toc)`
Adds toc structure.
`boolean`
`cascadeACL()`
Returns `true` (the default), a report element's ACL is automatically propagated to all its directly contained child elements and are added to their ACLs.
`Iterator`
`columnBindingsIterator()`
Deprecated.
since BIRT 2.1 RC2
`Iterator<FilterConditionHandle>`
`filtersIterator()`
Returns an iterator for the filter list defined on the group.
`String`
`getACLExpression()`
Returns the ACL expression associated with the report element instance.
`String`
`getBookmark()`
Returns the bookmark of listing group.
`String`
`getBookmarkDisplayName()`
Gets the display name of the bookmark.
`PropertyHandle`
`getColumnBindings()`
Deprecated.
since BIRT 2.1 RC2
`SlotHandle`
`getFooter()`
Returns the footer slot.
`String`
`getGroupStart()`
Deprecated.
by `getIntervalBase()`
`SlotHandle`
`getHeader()`
Returns the header slot in the group.
`String`
`getInterval()`
Returns the interval of this group.
`String`
`getIntervalBase()`
Return the interval base property value of this group.
`double`
`getIntervalRange()`
Returns the interval range of this group.
`String`
`getKeyExpr()`
Gets the expression that defines the group.
`String`
`getName()`
Gets the name of the group.
`String`
`getOnCreate()`
Gets the onCreate script of the group element.
`String`
`getOnPageBreak()`
Gets the on-pageBreak script of the group element.
`String`
`getOnPrepare()`
Gets the on-prepare script of the group.
`String`
`getOnRender()`
Gets the onRender script of the group element.
`String`
`getPageBreakAfter()`
Gets page break after property value of this group.
`String`
`getPageBreakBefore()`
Gets page break before property value of this group.
`String`
`getPageBreakInside()`
Gets page break inside property value of this group.
`String`
`getSortDirection()`
Returns the sort direction of this group.
`String`
`getSortType()`
Return the sort type.
`TOCHandle`
`getTOC()`
Gets TOC handle.
`String`
`getTocExpression()`
Deprecated.
`boolean`
`hasFooter()`
Checks whether the group footer slot is empty.
`boolean`
`hasHeader()`
Checks whether the group header slot is empty.
`boolean`
`hideDetail()`
Tests whether to hide the detail rows of this group.
`boolean`
`repeatHeader()`
Tests whether to repeat the headings at the top of each page.
`void`
`setACLExpression(String expr)`
Sets the ACL expression associated with the report element instance.
`void`
`setBookmark(String value)`
Sets the bookmark of listing group.
`void`
`setBookmarkDisplayName(String bookmarkDisplayName)`
Sets the display name of the bookmark.
`void`
`setCascadeACL(boolean cascadeACL)`
Sets the flag to control whether to cascade ACL
`void`
`setGroupStart(String groupStart)`
Deprecated.
by `setIntervalBase(String)`
`void`
`setHideDetail(boolean value)`
Sets whether to hide the detail rows of this group.
`void`
`setInterval(String interval)`
Returns the interval of this group.
`void`
`setIntervalBase(String intervalBase)`
Sets the base of the interval property of this group.IntervalBase, in conjunction with Interval and IntervalRange, determines how data is divided into groups.
`void`
`setIntervalRange(double intervalRange)`
Returns the interval range of this group.
`void`
`setIntervalRange(String intervalRange)`
Sets the interval range of group.
`void`
`setKeyExpr(String expr)`
Sets the group expression.
`void`
`setName(String theName)`
Sets the group name.
`void`
`setOnCreate(String script)`
Sets create property value of this group.
`void`
`setOnPageBreak(String script)`
Sets the on-pageBreak script of the group element.
`void`
`setOnPrepare(String script)`
Sets the on-prepare script of the group element.
`void`
`setOnRender(String script)`
Sets render property value of this group.
`void`
`setPageBreakAfter(String value)`
Sets page break after property value of this group.
`void`
`setPageBreakBefore(String value)`
Sets page break before property value of this group.
`void`
`setPageBreakInside(String value)`
Sets page break inside property value of this group.
`void`
`setRepeatHeader(boolean value)`
Sets whether to repeat the headings at the top of each page.
`void`
`setShowDetailFilter(boolean showDetailFilter)`
Sets the flag which indicates whether to show the detail filter or not.
`void`
`setSortDirection(String direction)`
Sets the sort direction of this group.
`void`
`setSortType(String sortType)`
Sets the sort type, which indicates the way of sorting
`void`
`setTocExpression(String expression)`
Deprecated.
`boolean`
`showDetailFilter()`
Gets the flag which indicates whether to show the detail filter or not.
`Iterator`
`sortsIterator()`
Returns the iterator for Sort list defined on the group.

### Methods inherited from class org.eclipse.birt.report.model.api.ReportElementHandle

`getComments, getCustomXml, getDisplayName, getDisplayNameKey, getElement, getPropertyMask, isValidLayoutForCompoundElement, isValidReferenceForCompoundElement, propertyMaskIterator, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setPropertyMask`

### Methods inherited from class org.eclipse.birt.report.model.api.DesignElementHandle

`add, add, addElement, addElement, addListener, addUserPropertyDefn, cachePropertyHandles, canContain, canContain, canContain, canContain, canDrop, canEdit, canTransformToTemplate, clearAllProperties, clearContents, clearProperty, clientsIterator, copy, copyPropertyTo, createTemplateElement, derivedIterator, doSort, drop, drop, drop, dropAndClear, dropAndClear, dropAndClear, dropUserPropertyDefn, findContentSlot, getBooleanProperty, getChoices, getColorProperty, getContainer, getContainerPropertyHandle, getContainerSlotHandle, getContent, getContentCount, getContents, getDefn, getDesign, getDesignHandle, getDimensionProperty, getDisplayLabel, getDisplayLabel, getDisplayProperty, getEffectiveModule, getElementFactory, getElementProperty, getEventHandlerClass, getExpressionProperty, getExtends, getExternalizedValue, getExternalizedValue, getExternalizedValue, getFactoryElementHandle, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getFullName, getHostViewHandle, getID, getIndex, getIntProperty, getListProperty, getListProperty, getMethods, getModule, getModuleHandle, getNumberProperty, getPrivateStyle, getProperty, getPropertyBinding, getPropertyBindingExpression, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getTagType, getUserProperties, getUserPropertyDefnHandle, getXPath, hasLocalProperties, hasSemanticError, initializeSlotHandles, isDirectionRTL, isInTemplateParameter, isTemplateParameterValue, isValid, localize, move, move, moveTo, moveTo, moveTo, moveTo, newHandlerOnEachEvent, paste, paste, paste, paste, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setBooleanProperty, setEncryption, setEventHandlerClass, setExpressionProperty, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setNewHandlerOnEachEvent, setNumberProperty, setProperties, setProperty, setPropertyBinding, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError, slotsIterator`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### GroupHandle

public GroupHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
Constructs a group handle with the given design and the design element. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.

Parameters:
  `module` - the module
  `element` - the model representation of the element

## Method Details

### getHeader

public SlotHandle getHeader()
Returns the header slot in the group. The header slot represents subsections that print at the start of the group.

Returns:
  a slot handle to the header

### getFooter

public SlotHandle getFooter()
Returns the footer slot. The footer slot represents subsections that print at the end of the group.

Returns:
  a slot handle to the footer

### getKeyExpr

public String getKeyExpr()
Gets the expression that defines the group. This is normally simply a reference to a data set column.

Returns:
  the expression as a string
See Also:
  - `setKeyExpr(String)`

### getName

public String getName()
Gets the name of the group.

Overrides:
  `getName` in class `DesignElementHandle`
Returns:
  the name of the group

### setName

public void setName(String theName) throws NameException
Sets the group name.

Overrides:
  `setName` in class `DesignElementHandle`
Parameters:
  `theName` - the group name to set
Throws:
  `NameException` - if the name is duplicate, or if the name is `null` and this element requires a name.

### setKeyExpr

public void setKeyExpr(String expr) throws SemanticException
Sets the group expression.

Parameters:
  `expr` - the expression to set
Throws:
  `SemanticException` - If the expression is invalid.
See Also:
  - `getKeyExpr()`

### sortsIterator

public Iterator sortsIterator()
Returns the iterator for Sort list defined on the group. The element in the iterator is the corresponding `StructureHandle`.

Returns:
  the iterator for `SortKey` structure list defined on the group.

### filtersIterator

public Iterator<FilterConditionHandle> filtersIterator()
Returns an iterator for the filter list defined on the group. Each object returned is of type `StructureHandle`.

Returns:
  the iterator for `FilterCond` structure list defined on the group.

### setGroupStart

@Deprecated public void setGroupStart(String groupStart) throws SemanticException
Deprecated.
by `setIntervalBase(String)`
Sets group start property of this group. Group start, in conjunction with Interval and IntervalRange, determines how data is divided into groups.

Parameters:
  `groupStart` - group start property value.
Throws:
  `SemanticException` - if the property is locked.

### getGroupStart

@Deprecated public String getGroupStart()
Deprecated.
by `getIntervalBase()`
Return the group start property value of this group.

Returns:
  group start property value of this group.

### setIntervalBase

public void setIntervalBase(String intervalBase) throws SemanticException
Sets the base of the interval property of this group.IntervalBase, in conjunction with Interval and IntervalRange, determines how data is divided into groups.

Parameters:
  `intervalBase` - interval base property value.
Throws:
  `SemanticException` - if the property is locked.

### getIntervalBase

public String getIntervalBase()
Return the interval base property value of this group.

Returns:
  interval baseF property value of this group.

### getInterval

public String getInterval()
Returns the interval of this group. The return value is defined in `DesignChoiceConstants` and can be one of:

- `INTERVAL_NONE`
- `INTERVAL_PREFIX`
- `INTERVAL_YEAR`
- `INTERVAL_QUARTER`
- `INTERVAL_MONTH`
- `INTERVAL_WEEK`
- `INTERVAL_DAY`
- `INTERVAL_HOUR`
- `INTERVAL_MINUTE`
- `INTERVAL_SECOND`
- `INTERVAL_INTERVAL`

Returns:
  the interval value as a string

### setInterval

public void setInterval(String interval) throws SemanticException
Returns the interval of this group. The input value is defined in `DesignChoiceConstants` and can be one of:

- `INTERVAL_NONE`
- `INTERVAL_PREFIX`
- `INTERVAL_YEAR`
- `INTERVAL_QUARTER`
- `INTERVAL_MONTH`
- `INTERVAL_WEEK`
- `INTERVAL_DAY`
- `INTERVAL_HOUR`
- `INTERVAL_MINUTE`
- `INTERVAL_SECOND`
- `INTERVAL_INTERVAL`

Parameters:
  `interval` - the interval value as a string
Throws:
  `SemanticException` - if the property is locked or the input value is not one of the above.

### getIntervalRange

public double getIntervalRange()
Returns the interval range of this group.

Returns:
  the interval range value as a double

### setIntervalRange

public void setIntervalRange(double intervalRange) throws SemanticException
Returns the interval range of this group.

Parameters:
  `intervalRange` - the interval range value as a double
Throws:
  `SemanticException` - if the property is locked.

### setIntervalRange

public void setIntervalRange(String intervalRange) throws SemanticException
Sets the interval range of group.

Parameters:
  `intervalRange` - the interval range value as a string.value is locale dependent.
Throws:
  `SemanticException` - if the property is locked.

### getSortDirection

public String getSortDirection()
Returns the sort direction of this group. The return value is defined in `DesignChoiceConstants` and can be one of:

- `SORT_DIRECTION_ASC`
- `SORT_DIRECTION_DESC`

Returns:
  the sort direction of this group

### setSortDirection

public void setSortDirection(String direction) throws SemanticException
Sets the sort direction of this group. The return value is defined in `DesignChoiceConstants` and can be one of:

- `SORT_DIRECTION_ASC`
- `SORT_DIRECTION_DESC`

Parameters:
  `direction` - the sort direction of this group
Throws:
  `SemanticException` - if the property is locked or the input value is not one of the above.

### hasHeader

public boolean hasHeader()
Checks whether the group header slot is empty.

Returns:
  true is the header slot is not empty, otherwise, return false.

### hasFooter

public boolean hasFooter()
Checks whether the group footer slot is empty.

Returns:
  true is the footer slot is not empty, otherwise, return false.

### setTocExpression

@Deprecated public void setTocExpression(String expression) throws SemanticException
Deprecated.
Sets a table of contents entry for this item. The TOC property defines an expression that returns a string that is to appear in the Table of Contents for this item or its container.

Parameters:
  `expression` - the expression that returns a string
Throws:
  `SemanticException` - if the TOC property is locked by the property mask.
See Also:
  - `getTocExpression()`

### getTocExpression

@Deprecated public String getTocExpression()
Deprecated.
Returns the expression evalueated as a table of contents entry for this item.

Returns:
  the expression evaluated as a table of contents entry for this item
See Also:
  - `setTocExpression(String)`

### setSortType

public void setSortType(String sortType) throws SemanticException
Sets the sort type, which indicates the way of sorting

Parameters:
  `sortType` - sort type.
Throws:
  `SemanticException` - if the property is locked.

### getSortType

public String getSortType()
Return the sort type.

Returns:
  the sort type.

### getOnPrepare

public String getOnPrepare()
Gets the on-prepare script of the group. Startup phase. No data binding yet. The design of an element can be changed here.

Returns:
  the on-prepare script of the group

### setOnPrepare

public void setOnPrepare(String script) throws SemanticException
Sets the on-prepare script of the group element.

Parameters:
  `script` - the script to set
Throws:
  `SemanticException` - if the method is locked.
See Also:
  - `getOnPrepare()`

### repeatHeader

public boolean repeatHeader()
Tests whether to repeat the headings at the top of each page.

Returns:
  `true` if repeat the headings, otherwise `false`.

### setRepeatHeader

public void setRepeatHeader(boolean value) throws SemanticException
Sets whether to repeat the headings at the top of each page.

Parameters:
  `value` - `true` if repeat the headings, otherwise `false`.
Throws:
  `SemanticException` - if the property is locked.

### getPageBreakAfter

public String getPageBreakAfter()
Gets page break after property value of this group.

Returns:
  page break after property value of this group.

### setPageBreakAfter

public void setPageBreakAfter(String value) throws SemanticException
Sets page break after property value of this group.

Parameters:
  `value` - value of page break after property
Throws:
  `SemanticException` - if the property is locked.

### getPageBreakInside

public String getPageBreakInside()
Gets page break inside property value of this group.

Returns:
  page break inside property value of this group.

### setPageBreakInside

public void setPageBreakInside(String value) throws SemanticException
Sets page break inside property value of this group.

Parameters:
  `value` - value of page break inside property
Throws:
  `SemanticException` - if the property is locked.

### getPageBreakBefore

public String getPageBreakBefore()
Gets page break before property value of this group.

Returns:
  page break before property value of this group.

### setPageBreakBefore

public void setPageBreakBefore(String value) throws SemanticException
Sets page break before property value of this group.

Parameters:
  `value` - value of page break before property
Throws:
  `SemanticException` - if the property is locked.

### hideDetail

public boolean hideDetail()
Tests whether to hide the detail rows of this group.

Returns:
  `true` if hide the detail rows, otherwise `false`.

### setHideDetail

public void setHideDetail(boolean value) throws SemanticException
Sets whether to hide the detail rows of this group.

Parameters:
  `value` - `true` if hide the detail rows, otherwise `false`.
Throws:
  `SemanticException` - if the property is locked.

### getOnPageBreak

public String getOnPageBreak()
Gets the on-pageBreak script of the group element. Presentation phase. It is for a script executed when the element is prepared for page breaking in the Presentation engine.

Returns:
  the on-pageBreak script of the group element

### setOnPageBreak

public void setOnPageBreak(String script) throws SemanticException
Sets the on-pageBreak script of the group element.

Parameters:
  `script` - the script to set
Throws:
  `SemanticException` - if the method is locked.
See Also:
  - `getOnPageBreak()`

### getOnCreate

public String getOnCreate()
Gets the onCreate script of the group element. Presentation phase. It is for a script executed when the element is prepared for creating in the Presentation engine.

Returns:
  the onCreate script of the group element

### setOnCreate

public void setOnCreate(String script) throws SemanticException
Sets create property value of this group.

Parameters:
  `value` - value of create property
Throws:
  `SemanticException` - if the property is locked.

### getOnRender

public String getOnRender()
Gets the onRender script of the group element. Presentation phase. It is for a script executed when the element is prepared for rendering in the Presentation engine.

Returns:
  the onCreate script of the group element

### setOnRender

public void setOnRender(String script) throws SemanticException
Sets render property value of this group.

Parameters:
  `value` - value of render property
Throws:
  `SemanticException` - if the property is locked.

### columnBindingsIterator

@Deprecated public Iterator columnBindingsIterator()
Deprecated.
since BIRT 2.1 RC2
Returns the bound columns that binds the data set columns. The item in the iterator is the corresponding `ComputedColumnHandle`.

Returns:
  a list containing the bound columns.

### getColumnBindings

@Deprecated public PropertyHandle getColumnBindings()
Deprecated.
since BIRT 2.1 RC2
Get a handle to deal with the bound column.

Returns:
  a handle to deal with the boudn data column.

### addColumnBinding

@Deprecated public ComputedColumnHandle addColumnBinding(ComputedColumn addColumn, boolean inForce) throws SemanticException
Deprecated.
since BIRT 2.1 RC2
Adds a bound column to the list.

Parameters:
  `addColumn` - the bound column to add
  `inForce` - `true` the column is added to the list regardless of duplicate expression. `false` do not add the column if the expression already exist
  `column` - the bound column
Returns:
  the newly created `ComputedColumnHandle` or the existed `ComputedColumnHandle` in the list
Throws:
  `SemanticException` - if expression is not duplicate but the name duplicates the exsiting bound column. Or, if the both name/expression are duplicate, but `inForce` is `true`.

### getTOC

public TOCHandle getTOC()
Gets TOC handle.

Returns:
  toc handle

### addTOC

public TOCHandle addTOC(String expression) throws SemanticException
Adds toc structure.

Parameters:
  `expression` - toc expression
Returns:
  toc handle
Throws:
  `SemanticException`

### addTOC

public TOCHandle addTOC(TOC toc) throws SemanticException
Adds toc structure.

Parameters:
  `toc` - toc structure
Returns:
  toc handle
Throws:
  `SemanticException`

### getBookmark

public String getBookmark()
Returns the bookmark of listing group.

Returns:
  the book mark as a string

### setBookmark

public void setBookmark(String value) throws SemanticException
Sets the bookmark of listing group.

Parameters:
  `value` - the property value to be set.
Throws:
  `SemanticException` - if the property is locked.

### getACLExpression

public String getACLExpression()
Returns the ACL expression associated with the report element instance.

Returns:
  the expression in string

### setACLExpression

public void setACLExpression(String expr) throws SemanticException
Sets the ACL expression associated with the report element instance.

Parameters:
  `expr` - the expression in string
Throws:
  `SemanticException` - if the property is locked by masks

### cascadeACL

public boolean cascadeACL()
Returns `true` (the default), a report element's ACL is automatically propagated to all its directly contained child elements and are added to their ACLs. Otherwise `false`.

Returns:
  the flag to control whether to cascade ACL

### setCascadeACL

public void setCascadeACL(boolean cascadeACL) throws SemanticException
Sets the flag to control whether to cascade ACL

Parameters:
  `cascadeACL` - `true` (the default), a report element's ACL is automatically propagated to all its directly contained child elements and are added to their ACLs. Otherwise `false`.
Throws:
  `SemanticException` - if the property is locked by masks

### getBookmarkDisplayName

public String getBookmarkDisplayName()
Gets the display name of the bookmark.

Returns:
  the display name of the bookmark.

### setBookmarkDisplayName

public void setBookmarkDisplayName(String bookmarkDisplayName) throws SemanticException
Sets the display name of the bookmark.

Parameters:
  `bookmarkDisplayName` - the display name of the bookmark to set
Throws:
  `SemanticException`

### showDetailFilter

public boolean showDetailFilter()
Gets the flag which indicates whether to show the detail filter or not.

Returns:
  true if the group shows the detail filter, otherwise false.

### setShowDetailFilter

public void setShowDetailFilter(boolean showDetailFilter) throws SemanticException
Sets the flag which indicates whether to show the detail filter or not.

Parameters:
  `showDetailFilter` - the new flag to set
Throws:
  `SemanticException`