Class GridHandle
- All Implemented Interfaces:
IReportItemMethodContext
,org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
,org.eclipse.birt.report.model.elements.interfaces.IGridItemModel
,org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel
,org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel
public class GridHandle
extends ReportItemHandle
implements org.eclipse.birt.report.model.elements.interfaces.IGridItemModel
Represents a grid item in the design. A grid item contains a set of report
items arranged into a grid. Grids contains rows and columns. The grid
contains cells. Each cell can span one or more columns, or one or more rows.
Each cell can contain one or more items.
Grid layout is familiar to anyone who has used HTML tables, Word tables or Excel: data is divided into a series of rows and columns.
- See Also:
-
GridItem
-
Field Summary
Fields inherited from class org.eclipse.birt.report.model.api.ReportItemHandleImpl
DATABINDING_TYPE_DATA, DATABINDING_TYPE_NONE, DATABINDING_TYPE_REPORT_ITEM_REF
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.IGridItemModel
CAPTION_KEY_PROP, CAPTION_PROP, COLUMN_SLOT, ROW_SLOT, SLOT_COUNT, SUMMARY_PROP
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel
ACL_EXPRESSION_PROP, ALLOW_EXPORT_PROP, ALTTEXT_KEY_PROP, ALTTEXT_PROP, BOOKMARK_DISPLAY_NAME_PROP, BOOKMARK_PROP, BOUND_DATA_COLUMNS_PROP, CASCADE_ACL_PROP, CUBE_PROP, DATA_BINDING_REF_PROP, DATA_SET_PROP, HEIGHT_PROP, LANGUAGE_PROP, MULTI_VIEWS_PROP, ON_CREATE_METHOD, ON_PAGE_BREAK_METHOD, ON_PREPARE_METHOD, ON_RENDER_METHOD, ORDER_PROP, PARAM_BINDINGS_PROP, PUSH_DOWN_PROP, TAG_TYPE_PROP, THEME_PROP, TOC_PROP, URL_PROP, VISIBILITY_PROP, WIDTH_PROP, X_PROP, Y_PROP, Z_INDEX_PROP
Fields inherited from interface org.eclipse.birt.report.model.api.elements.IReportItemMethodContext
ON_CREATE_CONTEXT, ON_PREPARE_CONTEXT, ON_RENDER_CONTEXT
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel
STYLE_PROP
-
Constructor Summary
ConstructorsConstructorDescriptionGridHandle
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Constructs a grid handle with the given design and the design element. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCopyColumn
(int columnIndex) Copies a column and cells under it with the given column number.boolean
canCopyRow
(RowOperationParameters parameters) Checks whether the copy operation can be done with the given parameters.boolean
canInsertAndPasteColumn
(ColumnBandData data, int columnIndex) Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag.boolean
canInsertAndPasteRow
(IDesignElement copiedRow, RowOperationParameters parameters) Checks whether the insert and paste table row to the given destination row with the given parameters.boolean
canInsertRow
(RowOperationParameters parameters) Checks whether the insert operation can be done with the given parameters.boolean
canPasteColumn
(ColumnBandData data, int columnIndex, boolean inForce) Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.boolean
canPasteRow
(IDesignElement copiedRow, RowOperationParameters parameters) Checks whether the paste operation can be done with the given parameters.boolean
canShiftColumn
(int sourceColumn, int destColumn) Moves the column fromsourceColumn
todestColumn
.boolean
canShiftRow
(RowOperationParameters parameters) Checks whether the shift operation can be done with the given the given parameters.copyColumn
(int columnIndex) Copies a column and cells under it with the given column number.copyRow
(RowOperationParameters parameters) Copies table row with the given parameters.Returns the caption text of this grid.Returns the resource key of the caption.getCell
(int row, int column) Gets the cell at the position where the given row and column intersect.getCellContent
(int row, int column) Gets the content slot handle of the cell at the position where the given row and column intersect.int
Returns the number of columns in the Grid.Returns a slot handle for the columns in the grid.getRows()
Returns a slot handle for the rows in the grid.Returns the value of the summary.void
insertAndPasteColumn
(ColumnBandData data, int columnNumber) Inserts and pastes a column with its cells to the given column number.void
insertAndPasteRow
(IDesignElement copiedRow, RowOperationParameters parameters) Inserts and paste table row to the given destination row with the given parameters.void
insertRow
(RowOperationParameters parameters) Inserts table row to the given destination row with the given parameters.void
pasteColumn
(ColumnBandData data, int columnNumber, boolean inForce) Pastes a column with its cells to the given column number.void
pasteRow
(IDesignElement copiedRow, RowOperationParameters parameters) Pastes table row to destination row with the given parameters.void
setCaption
(String caption) Sets the caption text of this grid.void
setCaptionKey
(String captionKey) Sets the resource key of the caption.void
setSummary
(String summary) Sets the value of summary.void
shiftColumn
(int sourceColumn, int destColumn) Moves the column fromsourceColumn
todestIndex
.void
shiftRow
(RowOperationParameters parameters) Shifts table row to the given destination row with the given parameters.Methods inherited from class org.eclipse.birt.report.model.api.ReportItemHandleImpl
addColumnBinding, addTOC, addTOC, addView, allowExport, canAddView, canCascadeACL, cascadeACL, columnBindingsIterator, dropView, findColumnBinding, getACLExpression, getAltTextExpression, getAltTextKey, getAvailableBindings, getAvailableCubeBindingReferenceList, getAvailableDataBindingReferenceList, getAvailableDataBindingReferenceList, getAvailableDataSetBindingReferenceList, getBookmark, getBookmarkDisplayName, getColumnBindings, getCube, getCurrentView, getDataBindingReference, getDataBindingReferenceName, getDataBindingType, getDataSet, getHeight, getLanguage, getMethods, getNamedCubeBindingReferenceList, getNamedDataBindingReferenceList, getNamedDataSetBindingReferenceList, getOnCreate, getOnPageBreak, getOnPrepare, getOnRender, getOrder, getProperty, getTagType, getTheme, getTOC, getTocExpression, getURL, getViewHost, getViews, getWidth, getX, getY, getZIndex, paramBindingsIterator, pushDown, removedColumnBinding, removedColumnBindings, removedUnusedColumnBindings, setACLExpression, setAllowExport, setAltTextExpression, setAltTextKey, setBookmark, setBookmarkDisplayName, setCascadeACL, setCube, setCurrentView, setDataBindingReference, setDataSet, setHeight, setHeight, setLanguage, setOnCreate, setOnPageBreak, setOnPrepare, setOnRender, setOrder, setPushDown, setTagType, setTheme, setThemeName, setTocExpression, setURL, setWidth, setWidth, setX, setX, setY, setY, setZIndex, visibilityRulesIterator
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, getName, getNumberProperty, getPrivateStyle, getPropertyBinding, getPropertyBindingExpression, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, 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, setName, setNewHandlerOnEachEvent, setNumberProperty, setProperties, setProperty, setPropertyBinding, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError, slotsIterator
-
Constructor Details
-
GridHandle
public GridHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Constructs a grid 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 moduleelement
- the model representation of the element
-
-
Method Details
-
getColumns
Returns a slot handle for the columns in the grid.- Returns:
- a handle to the column slot
- See Also:
-
getRows
Returns a slot handle for the rows in the grid.- Returns:
- a handle to the row slot
- See Also:
-
getColumnCount
public int getColumnCount()Returns the number of columns in the Grid. The number is defined as the sum of columns described in the "column" slot.- Returns:
- the number of columns in the grid.
-
getCell
Gets the cell at the position where the given row and column intersect.- Parameters:
row
- the row position indexing from 1column
- the column position indexing from 1- Returns:
- the cell handle at the position if the cell exists, otherwise
null
-
getCellContent
Gets the content slot handle of the cell at the position where the given row and column intersect.- Parameters:
row
- the row position indexing from 1column
- the column position indexing from 1- Returns:
- the content slot handle of the cell at the position if the cell
exists, otherwise
null
-
canCopyColumn
public boolean canCopyColumn(int columnIndex) Copies a column and cells under it with the given column number.- Parameters:
columnIndex
- the column position indexing from 1.- Returns:
true
if this column band can be copied. Otherwisefalse
.
-
copyColumn
Copies a column and cells under it with the given column number.- Parameters:
columnIndex
- the column number- Returns:
- a new
GridColumnBandAdapter
instance - Throws:
SemanticException
- if the cell layout of the column is invalid.
-
pasteColumn
public void pasteColumn(ColumnBandData data, int columnNumber, boolean inForce) throws SemanticException Pastes a column with its cells to the given column number.- Parameters:
data
- the data of a column band to pastecolumnNumber
- the column index from 1 to the number of columns in the gridinForce
-true
if pastes the column regardless of the warning. Otherwisefalse
.- Throws:
SemanticException
-
canPasteColumn
Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.- Parameters:
data
- the column band data to pastecolumnIndex
- the column index from 1 to the number of columns in the gridinForce
-true
indicates to paste the column regardless of the different layout of cells.false
indicates not.- Returns:
true
indicates the paste operation can be done. Otherwisefalse
.
-
insertAndPasteColumn
Inserts and pastes a column with its cells to the given column number.- Parameters:
data
- the data of a column band to pastecolumnNumber
- the column index from 0 to the number of columns in the grid- Throws:
SemanticException
-
canInsertAndPasteColumn
Checks whether the insert and paste operation can be done with the given copied column band data, the column index and the operation flag. This is different fromcanPasteColumn
since this action creates an extra column for the table.- Parameters:
data
- the column band data to pastecolumnIndex
- the column index from 0 to the number of columns in the grid- Returns:
true
indicates the paste operation can be done. Otherwisefalse
.
-
shiftColumn
Moves the column fromsourceColumn
todestIndex
.- Parameters:
sourceColumn
- the source column ranging from 1 to the column numberdestColumn
- the target column ranging from 0 to the column number- Throws:
SemanticException
- if the chosen column band is forbidden to shift
-
canShiftColumn
public boolean canShiftColumn(int sourceColumn, int destColumn) Moves the column fromsourceColumn
todestColumn
.- Parameters:
sourceColumn
- the source column ranging from 1 to the column numberdestColumn
- the target column ranging from 0 to the column number- Returns:
true
if the chosen column band is legal to shift. Otherwisefalse
.
-
canCopyRow
Checks whether the copy operation can be done with the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Returns:
true
if this row band can be copied. Otherwisefalse
.
-
canPasteRow
Checks whether the paste operation can be done with the given parameters.- Parameters:
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.- Returns:
true
indicates the paste operation can be done. Otherwisefalse
.
-
canInsertRow
Checks whether the insert operation can be done with the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Returns:
true
indicates the insert operation can be done. Otherwisefalse
.
-
canInsertAndPasteRow
Checks whether the insert and paste table row to the given destination row with the given parameters.- Parameters:
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.- Returns:
true
indicates the insert and paste operation can be done. Otherwisefalse
.
-
canShiftRow
Checks whether the shift operation can be done with the given the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Returns:
true
indicates the shift operation can be done. Otherwisefalse
.
-
copyRow
Copies table row with the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Returns:
- a new
TableRow
instance - Throws:
SemanticException
- throw if paste operation is forbiddenIllegalArgumentException
- throw if the input parameters are not valid
-
pasteRow
public void pasteRow(IDesignElement copiedRow, RowOperationParameters parameters) throws SemanticException Pastes table row to destination row with the given parameters.- Parameters:
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.- Throws:
SemanticException
- throw if paste operation is forbiddenIllegalArgumentException
- throw if the input parameters are not valid
-
insertRow
Inserts table row to the given destination row with the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Throws:
SemanticException
- throw if paste operation is forbiddenIllegalArgumentException
- throw if the input parameters are not valid
-
insertAndPasteRow
public void insertAndPasteRow(IDesignElement copiedRow, RowOperationParameters parameters) throws SemanticException Inserts and paste table row to the given destination row with the given parameters.- Parameters:
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.- Throws:
SemanticException
- throw if paste operation is forbiddenIllegalArgumentException
- throw if the input parameters are not valid
-
shiftRow
Shifts table row to the given destination row with the given parameters.- Parameters:
parameters
- parameters needed by insert operation.- Throws:
SemanticException
- throw if paste operation is forbiddenIllegalArgumentException
- throw if the input parameters are not valid
-
getCaption
Returns the caption text of this grid.- Returns:
- the caption text
-
setCaption
Sets the caption text of this grid.- Parameters:
caption
- the caption text- Throws:
SemanticException
- if the property is locked.
-
getCaptionKey
Returns the resource key of the caption.- Returns:
- the resource key of the caption
-
setCaptionKey
Sets the resource key of the caption.- Parameters:
captionKey
- the resource key of the caption- Throws:
SemanticException
- if the caption resource-key property is locked.
-
getSummary
Returns the value of the summary.- Returns:
- the value of summary
-
setSummary
Sets the value of summary.- Parameters:
summary
- the value of summary- Throws:
SemanticException
-