public class TableHandle extends ListingHandle implements org.eclipse.birt.report.model.elements.interfaces.ITableItemModel
To get the layout of a table, it is recommended to use
LayoutTableModel
.
TableItem
,
LayoutTableModel
DATABINDING_TYPE_DATA, DATABINDING_TYPE_NONE, DATABINDING_TYPE_REPORT_ITEM_REF
element
module
CAPTION_KEY_PROP, CAPTION_PROP, COLUMN_SLOT, IS_SUMMARY_TABLE_PROP, SUMMARY_PROP
DETAIL_SLOT, FILTER_PROP, FOOTER_SLOT, GROUP_SLOT, HEADER_SLOT, ON_FINISH_METHOD, ON_ROW_METHOD, ON_START_METHOD, PAGE_BREAK_INTERVAL_PROP, REPEAT_HEADER_PROP, SORT_BY_GROUPS_PROP, SORT_PROP
ACL_EXPRESSION_PROP, ALLOW_EXPORT_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, ROLE_PROP, THEME_PROP, TOC_PROP, URL_PROP, VISIBILITY_PROP, WIDTH_PROP, X_PROP, Y_PROP, Z_INDEX_PROP
STYLE_PROP
ON_CREATE_CONTEXT, ON_PREPARE_CONTEXT, ON_RENDER_CONTEXT
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
Constructor and Description |
---|
TableHandle(org.eclipse.birt.report.model.core.Module module,
org.eclipse.birt.report.model.core.DesignElement element)
Constructs a handle for the table with the given design and element.
|
Modifier and Type | Method and Description |
---|---|
boolean |
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 inserting and paste table row to the given destination
row with the given parameters.
|
boolean |
canInsertRow(RowOperationParameters parameters)
Checks whether inserting an empty table row 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 from
sourceColumn to
destColumn . |
boolean |
canShiftRow(RowOperationParameters parameters)
Checks whether the shift operation can be done with the given the given
parameters.
|
ColumnBandData |
copyColumn(int columnIndex)
Copies a column and cells under it with the given column number.
|
IDesignElement |
copyRow(RowOperationParameters parameters)
Copies table row with the given parameters.
|
ColumnHandle |
findColumn(int columnIndex)
Figures out the column according to the index of the column.
|
java.lang.String |
getCaption()
Returns the caption text of this table.
|
java.lang.String |
getCaptionKey()
Returns the resource key of the caption.
|
protected CellHandle |
getCell(int row,
int column)
Gets the cell at the position where the given row and column intersect
regardless of slot information.
|
CellHandle |
getCell(int slotId,
int groupLevel,
int row,
int column)
Gets the cell at the position where the given row and column intersect
within the given slot.
|
int |
getColumnCount()
Returns the number of columns in the table.
|
SlotHandle |
getColumns()
Returns the column slot.
|
java.util.List |
getFilters(int colIndex)
Returns a list containing filters applied to the column at position of
colIndex.
|
LayoutTableModel |
getLayoutModel()
Returns the layout model of the table.
|
java.lang.String |
getSummary()
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 |
insertColumn(int columnNumber,
int positionFlag)
Inserts a column to the table.
|
void |
insertRow(RowOperationParameters parameters)
Inserts table row to the given destination row with the given parameters.
|
boolean |
isSummaryTable()
Returns if the table is a summary table.
|
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(java.lang.String caption)
Sets the caption text of this table.
|
void |
setCaptionKey(java.lang.String captionKey)
Sets the resource key of the caption.
|
void |
setIsSummaryTable(boolean isSummaryTable)
Sets the flag to control whether the table is a summary table.
|
void |
setSummary(java.lang.String summary)
Sets the value of summary.
|
void |
setWidthToFitColumns()
Sets the width of the table to fit columns' widths with default dpi
value.
|
void |
setWidthToFitColumns(int dpi)
Sets the width of the table to fit columns' widths with the given dpi
value.
|
void |
shiftColumn(int sourceColumn,
int destColumn)
Moves the column from
sourceColumn to destIndex
. |
void |
shiftRow(RowOperationParameters parameters)
Shifts table row to the given destination row with the given parameters.
|
filtersIterator, getDetail, getFooter, getGroups, getHeader, getPageBreakInterval, isSortByGroups, repeatHeader, setPageBreakInterval, setRepeatHeader, setSortByGroups, sortsIterator
addColumnBinding, addTOC, addTOC, addView, allowExport, canAddView, canCascadeACL, cascadeACL, columnBindingsIterator, dropView, findColumnBinding, getACLExpression, getAltText, 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, getRole, getTheme, getTOC, getTocExpression, getURL, getViewHost, getViews, getWidth, getX, getY, getZIndex, paramBindingsIterator, pushDown, removedColumnBinding, removedColumnBindings, removedUnusedColumnBindings, setACLExpression, setAllowExport, setAltText, setBookmark, setBookmarkDisplayName, setCascadeACL, setCube, setCurrentView, setDataBindingReference, setDataSet, setHeight, setHeight, setLanguage, setOnCreate, setOnPageBreak, setOnPrepare, setOnRender, setOrder, setPushDown, setRole, setTheme, setThemeName, setTocExpression, setURL, setWidth, setWidth, setX, setX, setY, setY, setZIndex, visibilityRulesIterator
getComments, getCustomXml, getDisplayName, getDisplayNameKey, getElement, getPropertyMask, isValidLayoutForCompoundElement, isValidReferenceForCompoundElement, propertyMaskIterator, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setPropertyMask
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, 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
public TableHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
module
- the moduleelement
- the model representation of the elementpublic SlotHandle getColumns()
SlotHandle
public int getColumnCount()
public java.lang.String getCaption()
public void setCaption(java.lang.String caption) throws SemanticException
caption
- the caption textSemanticException
- if the property is locked.public java.lang.String getSummary()
public void setSummary(java.lang.String summary) throws SemanticException
summary
- the value of summarySemanticException
public java.lang.String getCaptionKey()
public void setCaptionKey(java.lang.String captionKey) throws SemanticException
captionKey
- the resource key of the captionSemanticException
- if the caption resource-key property is locked.public boolean canCopyColumn(int columnIndex)
columnIndex
- the column position indexing from 1.true
if this column band can be copied. Otherwise
false
.public boolean canPasteColumn(ColumnBandData data, int columnIndex, boolean inForce)
data
- the column band data to pastecolumnIndex
- the column index from 1 to the number of columns in the tableinForce
- true
indicates to paste the column regardless of
the different layout of cells. false
indicates
not.true
indicates the paste operation can be done.
Otherwise false
.public boolean canCopyRow(RowOperationParameters parameters)
parameters
- parameters needed by insert operation.true
if this row band can be copied. Otherwise
false
.public boolean canPasteRow(IDesignElement copiedRow, RowOperationParameters parameters)
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.true
indicates the paste operation can be done.
Otherwise false
.public boolean canInsertRow(RowOperationParameters parameters)
parameters
- parameters needed by insert operation.true
indicates the insert operation can be done.
Otherwise false
.public boolean canInsertAndPasteRow(IDesignElement copiedRow, RowOperationParameters parameters)
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.true
indicates the insert and paste operation can be
done. Otherwise false
.public boolean canShiftRow(RowOperationParameters parameters)
parameters
- parameters needed by insert operation.true
indicates the shift operation can be done.
Otherwise false
.public ColumnBandData copyColumn(int columnIndex) throws SemanticException
columnIndex
- the column numberColumnBandAdapter
instanceSemanticException
- if the cell layout of the column is invalid.public void pasteColumn(ColumnBandData data, int columnNumber, boolean inForce) throws SemanticException
data
- the data of a column band to pastecolumnNumber
- the column index from 1 to the number of columns in the tableinForce
- true
if pastes the column regardless of the
warning. Otherwise false
.SemanticException
public IDesignElement copyRow(RowOperationParameters parameters) throws SemanticException
parameters
- parameters needed by insert operation.TableRow
instanceSemanticException
- throw if paste operation is forbiddenjava.lang.IllegalArgumentException
- throw if the input parameters are not validpublic void pasteRow(IDesignElement copiedRow, RowOperationParameters parameters) throws SemanticException
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.SemanticException
- throw if paste operation is forbiddenjava.lang.IllegalArgumentException
- throw if the input parameters are not validpublic void insertRow(RowOperationParameters parameters) throws SemanticException
parameters
- parameters needed by insert operation.SemanticException
- throw if paste operation is forbiddenjava.lang.IllegalArgumentException
- throw if the input parameters are not validpublic void insertAndPasteRow(IDesignElement copiedRow, RowOperationParameters parameters) throws SemanticException
copiedRow
- the copied table rowparameters
- parameters needed by insert operation.SemanticException
- throw if paste operation is forbiddenjava.lang.IllegalArgumentException
- throw if the input parameters are not validpublic void shiftRow(RowOperationParameters parameters) throws SemanticException
parameters
- parameters needed by insert operation.SemanticException
- throw if paste operation is forbiddenjava.lang.IllegalArgumentException
- throw if the input parameters are not validpublic void insertAndPasteColumn(ColumnBandData data, int columnNumber) throws SemanticException
data
- the data of a column band to pastecolumnNumber
- the column index from 0 to the number of columns in the tableSemanticException
public boolean canInsertAndPasteColumn(ColumnBandData data, int columnIndex)
canPasteColumn
since this action creates an
extra column for the table.data
- the column band data to pastecolumnIndex
- the column index from 0 to the number of columns in the tabletrue
indicates the paste operation can be done.
Otherwise false
.public void shiftColumn(int sourceColumn, int destColumn) throws SemanticException
sourceColumn
to destIndex
.sourceColumn
- the source column ranging from 1 to the column numberdestColumn
- the target column ranging from 0 to the column numberSemanticException
- if the chosen column band is forbidden to shiftpublic boolean canShiftColumn(int sourceColumn, int destColumn)
sourceColumn
to
destColumn
.sourceColumn
- the source column ranging from 1 to the column numberdestColumn
- the target column ranging from 0 to the column numbertrue
if the chosen column band is legal to shift.
Otherwise false
.public LayoutTableModel getLayoutModel()
public void insertColumn(int columnNumber, int positionFlag) throws SemanticException
The insert action cannot be finished succesfully for cases like this:
<cell colSpan="1/><cell colSpan="1/> <cell colSpan="2/>if the user want to insert a column with cells to the column 2.
columnNumber
- The 1-based column number.positionFlag
- The column insert sign. 1 insert after position. -1 insert
before positionSemanticException
- if the given position is occupied by any cell with a column
span equal or greater than 1.protected CellHandle getCell(int row, int column)
row
- the row position indexing from 1column
- the column position indexing from 1null
public CellHandle getCell(int slotId, int groupLevel, int row, int column)
If groupLevel
is less or equal than 0, then retrieve cell
from header/detail/footer. If not, return the cell from the given group.
slotId
- the slot idgroupLevel
- the group level indexing from 1. Or -1 if to get the cell from
header/detail/footer.row
- the row position indexing from 1column
- the column position indexing from 1null
public ColumnHandle findColumn(int columnIndex)
columnIndex
- the 1-based column indexpublic java.util.List getFilters(int colIndex)
colIndex
- the column index ranging from 0 to columnCount - 1public boolean isSummaryTable()
true if the table is a summary table.Otherwise false.
public void setIsSummaryTable(boolean isSummaryTable) throws SemanticException
isSummaryTable
- the flag to setSemanticException
public void setWidthToFitColumns() throws SemanticException
SemanticException
- when width of the table cannot be calculated.public void setWidthToFitColumns(int dpi) throws SemanticException
dpi
- the dpi valueSemanticException
- when width of the table cannot be calculated.Copyright © 2014 OpenText Corp. All rights reserved.