org.eclipse.birt.report.model.api
Class TableHandle

java.lang.Object
  extended byorg.eclipse.birt.report.model.api.DesignElementHandle
      extended byorg.eclipse.birt.report.model.api.ReportElementHandle
          extended byorg.eclipse.birt.report.model.api.ReportItemHandle
              extended byorg.eclipse.birt.report.model.api.ListingHandle
                  extended byorg.eclipse.birt.report.model.api.TableHandle
All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IListingElementModel, org.eclipse.birt.report.model.elements.interfaces.IReportItemModel, org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel, org.eclipse.birt.report.model.elements.interfaces.ITableItemModel

public class TableHandle
extends ListingHandle
implements org.eclipse.birt.report.model.elements.interfaces.ITableItemModel

Represents a table element. A table has a localized caption and can repeat its heading at the top of each page. The table is a list that is structured into a rows and columns. The columns are defined for the entire table. Rows are clustered into a set of groups.

To get the layout of a table, it is recommended to use LayoutTableModel.

See Also:
TableItem, LayoutTableModel

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.ITableItemModel
CAPTION_KEY_PROP, CAPTION_PROP, COLUMN_SLOT, REPEAT_HEADER_PROP
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IListingElementModel
DETAIL_SLOT, FILTER_PROP, FOOTER_SLOT, GROUP_SLOT, HEADER_SLOT, ON_FINISH_METHOD, ON_ROW_METHOD, ON_START_METHOD, PAGE_BREAK_INTERVAL_PROP, SORT_PROP
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IReportItemModel
BOOKMARK_PROP, DATA_SET_PROP, HEIGHT_PROP, ON_CREATE_METHOD, ON_PREPARE_METHOD, ON_RENDER_METHOD, PARAM_BINDINGS_PROP, TOC_PROP, VISIBILITY_PROP, WIDTH_PROP, X_PROP, Y_PROP
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel
STYLE_PROP
 
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, NO_SLOT, PROPERTY_MASKS_PROP, REF_TEMPLATE_PARAMETER_PROP, SHORT_LABEL, USER_LABEL, USER_PROPERTIES_PROP
 
Constructor Summary
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.
 
Method Summary
 boolean canCopyColumn(int columnIndex)
          Copies a column and cells under it with the given column number.
 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 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 canShiftColumn(int sourceColumn, int destColumn)
          Moves the column from sourceColumn to destColumn.
 ColumnBandData copyColumn(int columnIndex)
          Copies a column and cells under it with the given column number.
 java.lang.String getCaption()
          Returns the caption text of this table.
 java.lang.String getCaptionKey()
          Returns the resource key of the caption.
 int getColumnCount()
          Returns the number of columns in the table.
 SlotHandle getColumns()
          Returns the column slot.
 LayoutTableModel getLayoutModel()
          Returns the layout model of the table.
 void insertAndPasteColumn(ColumnBandData data, int columnNumber)
          Inserts and pastes a column with its cells to the given column number.
 void pasteColumn(ColumnBandData data, int columnNumber, boolean inForce)
          Pastes a column with its cells to the given column number.
 boolean repeatHeader()
          Tests whether to repeat the headings at the top of each page.
 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 setRepeatHeader(boolean value)
          Sets whether to repeat the headings at the top of each page.
 void shiftColumn(int sourceColumn, int destColumn)
          Moves the column from sourceColumn to destIndex.
 
Methods inherited from class org.eclipse.birt.report.model.api.ListingHandle
filtersIterator, getDetail, getFooter, getGroups, getHeader, getPageBreakInterval, setPageBreakInterval, sortsIterator
 
Methods inherited from class org.eclipse.birt.report.model.api.ReportItemHandle
getBookmark, getDataSet, getHeight, getOnCreate, getOnPrepare, getOnRender, getTocExpression, getWidth, getX, getY, paramBindingsIterator, setBookmark, setDataSet, setHeight, setHeight, setOnCreate, setOnPrepare, setOnRender, setTocExpression, setWidth, setWidth, setX, setX, setY, setY, visibilityRulesIterator
 
Methods inherited from class org.eclipse.birt.report.model.api.ReportElementHandle
getComments, getCustomXml, getDisplayName, getDisplayNameKey, getElement, getPropertyMask, isValidReferenceForCompoundElement, propertyMaskIterator, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setPropertyMask
 
Methods inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
addElement, addElement, addListener, addUserPropertyDefn, canContain, canContain, canDrop, canEdit, canTransformToTemplate, clearAllProperties, clearContents, clearProperty, clientsIterator, copy, copyPropertyTo, createTemplateElement, derivedIterator, doSort, drop, dropAndClear, dropUserPropertyDefn, findContentSlot, getBooleanProperty, getChoices, getColorProperty, getContainer, getContainerSlotHandle, getDefn, getDesign, getDesignHandle, getDimensionProperty, getDisplayLabel, getDisplayLabel, getDisplayProperty, getEffectiveModule, getElementFactory, getElementProperty, getEventHandlerClass, getExtends, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getID, getIntProperty, getListProperty, getMethods, getModule, getModuleHandle, getName, getNumberProperty, getPrivateStyle, getProperty, getPropertyBinding, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getUserProperties, getUserPropertyDefnHandle, getXPath, hasLocalProperties, hasSemanticError, isTemplateParameterValue, isValid, localize, moveTo, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setEventHandlerClass, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setName, setNumberProperty, setProperties, setProperty, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, showError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableHandle

public 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. 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 Detail

getColumns

public SlotHandle getColumns()
Returns the column slot. The column slot represents a list of Column elements that describe the table columns.

Returns:
a handle to the detail slot
See Also:
SlotHandle

getColumnCount

public int getColumnCount()
Returns the number of columns in the table. The number is defined as 1) the sum of columns described in the "column" slot, or 2) the widest row defined in the detail, header or footer slots if column slot is empty.

Returns:
the number of columns in the table

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.

getCaption

public java.lang.String getCaption()
Returns the caption text of this table.

Returns:
the caption text

setCaption

public void setCaption(java.lang.String caption)
                throws SemanticException
Sets the caption text of this table.

Parameters:
caption - the caption text
Throws:
SemanticException - if the property is locked.

getCaptionKey

public java.lang.String getCaptionKey()
Returns the resource key of the caption.

Returns:
the resource key of the caption

setCaptionKey

public void setCaptionKey(java.lang.String captionKey)
                   throws SemanticException
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.

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. Otherwise false.

canPasteColumn

public 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.

Parameters:
data - the column band data to paste
columnIndex - the column index from 1 to the number of columns in the table
inForce - 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. Otherwise false.

copyColumn

public ColumnBandData copyColumn(int columnIndex)
                          throws SemanticException
Copies a column and cells under it with the given column number.

Parameters:
columnIndex - the column number
Returns:
a new ColumnBandAdapter 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 paste
columnNumber - the column index from 1 to the number of columns in the table
inForce - true if pastes the column regardless of the warning. Otherwise false.
Throws:
SemanticException

insertAndPasteColumn

public void insertAndPasteColumn(ColumnBandData data,
                                 int columnNumber)
                          throws SemanticException
Inserts and pastes a column with its cells to the given column number.

Parameters:
data - the data of a column band to paste
columnNumber - the column index from 0 to the number of columns in the table
Throws:
SemanticException

canInsertAndPasteColumn

public 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. This is different from canPasteColumn since this action creates an extra column for the table.

Parameters:
data - the column band data to paste
columnIndex - the column index from 0 to the number of columns in the table
Returns:
true indicates the paste operation can be done. Otherwise false.

shiftColumn

public void shiftColumn(int sourceColumn,
                        int destColumn)
                 throws SemanticException
Moves the column from sourceColumn to destIndex.

Parameters:
sourceColumn - the source column ranging from 1 to the column number
destColumn - 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 from sourceColumn to destColumn.

Parameters:
sourceColumn - the source column ranging from 1 to the column number
destColumn - the target column ranging from 0 to the column number
Returns:
true if the chosen column band is legal to shift. Otherwise false.

getLayoutModel

public LayoutTableModel getLayoutModel()
Returns the layout model of the table.

Returns:
the layout model of the table


Copyright © 2005 Actuate Corp. All rights reserved.