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

java.lang.Object
  extended by org.eclipse.birt.report.model.api.DesignElementHandle
      extended by org.eclipse.birt.report.model.api.ReportElementHandle
          extended by org.eclipse.birt.report.model.api.CellHandle
All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.ICellModel, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel

public class CellHandle
extends ReportElementHandle
implements org.eclipse.birt.report.model.elements.interfaces.ICellModel

Represents a cell within a table or grid. A cell can span multiple rows and/or columns. A cell can contain zero, one or many contents. However, since BIRT will position multiple items automatically, the application should generally provide its own container if the cell is to hold multiple items.

The application generally does not create cell handles directly. Instead, it uses one of the navigation methods available on other element handles such as RowHandle.

See Also:
Cell, RowHandle.getCells()

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.ICellModel
COL_SPAN_PROP, COLUMN_PROP, CONTENT_SLOT, DROP_PROP, HEIGHT_PROP, ON_CREATE_METHOD, ON_PREPARE_METHOD, ON_RENDER_METHOD, ROW_SPAN_PROP, STYLE_PROP, WIDTH_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, VIEW_ACTION_PROP
 
Constructor Summary
CellHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
          Constructs a handle for the given design and design element.
 
Method Summary
 int getColumn()
          Returns the cell's column property.
 int getColumnSpan()
          Returns the cell's column span.
 SlotHandle getContent()
          Returns the contents of the cell.
 java.lang.String getDrop()
          Returns the cell's drop property.
 java.lang.String getEventHandleClass()
          Gets a string that defines the event handle class.
 DimensionHandle getHeight()
          Returns the cell's height.
 java.lang.String getOnCreate()
          Gets the on-finish script of the group.
 java.lang.String getOnPrepare()
          Gets the on-prepare script of the group.
 java.lang.String getOnRender()
          Gets the on-finish script of the group.
 int getRowSpan()
          Returns the cell's row span.
 DimensionHandle getWidth()
          Returns the cell's width.
 void setColumn(int column)
          Sets the cell's column property.
 void setColumnSpan(int span)
          Sets the cell's column span.
 void setDrop(java.lang.String drop)
          Sets the cell's drop property.
 void setEventHandleClass(java.lang.String expr)
          Sets the group expression.
 void setOnCreate(java.lang.String script)
          Sets the on-create script of the group element.
 void setOnPrepare(java.lang.String script)
          Sets the on-prepare script of the group element.
 void setOnRender(java.lang.String script)
          Sets the on-render script of the group element.
 void setRowSpan(int span)
          Sets the cell's row span.
 
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, getExtends, getExternalizedValue, getExternalizedValue, getExternalizedValue, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getFullName, getHostViewHandle, getID, getIndex, getIntProperty, getListProperty, getListProperty, getMethods, getModule, getModuleHandle, getName, getNumberProperty, getPrivateStyle, getProperty, getPropertyBinding, 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, paste, paste, paste, paste, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setEncryption, setEventHandlerClass, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setName, setNumberProperty, setProperties, setProperty, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellHandle

public CellHandle(org.eclipse.birt.report.model.core.Module module,
                  org.eclipse.birt.report.model.core.DesignElement element)
Constructs a handle for the given design and 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 Detail

getColumnSpan

public int getColumnSpan()
Returns the cell's column span. This is the number of table or grid columns occupied by this cell.

Returns:
the column span

setColumnSpan

public void setColumnSpan(int span)
                   throws SemanticException
Sets the cell's column span. This is the number of table or grid columns occupied by this cell.

Parameters:
span - the column span
Throws:
SemanticException - if this property is locked.

getRowSpan

public int getRowSpan()
Returns the cell's row span. This is the number of table or grid rows occupied by this cell.

Returns:
the row span

setRowSpan

public void setRowSpan(int span)
                throws SemanticException
Sets the cell's row span. This is the number of table or grid rows occupied by this cell.

Parameters:
span - the row span
Throws:
SemanticException - if this property is locked.

getDrop

public java.lang.String getDrop()
Returns the cell's drop property. This is how the cell should expand to fill the entire table or group. This property is valid only for cells within a table; but not for cells within a grid.

Returns:
the string value of the drop property
See Also:
setDrop(String)

setDrop

public void setDrop(java.lang.String drop)
             throws SemanticException
Sets the cell's drop property. The input value is defined in DesignChoiceConstants and can be one of:

Note that This property is valid only for cells within a table; but not for cells within a grid.

Parameters:
drop - the string value of the drop property
Throws:
SemanticException - if the property is locked or the input value is not one of the above.
See Also:
getDrop()

getContent

public SlotHandle getContent()
Returns the contents of the cell. The cell can contain any number of items, but normally contains just one.

Returns:
a handle to the content slot

getColumn

public int getColumn()
Returns the cell's column property. The return value gives the column in which the cell starts. Columns are numbered from 1.

Returns:
the column index, starting from 1.

setColumn

public void setColumn(int column)
               throws SemanticException
Sets the cell's column property. The input value gives the column in which the cell starts. Columns are numbered from 1.

Parameters:
column - the column index, starting from 1.
Throws:
SemanticException - if this property is locked.

getHeight

public DimensionHandle getHeight()
Returns the cell's height.

Returns:
the cell's height

getWidth

public DimensionHandle getWidth()
Returns the cell's width.

Returns:
the cell's width

getOnPrepare

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

getOnCreate

public java.lang.String getOnCreate()
Gets the on-finish script of the group. Presentation phase. The report item has been read from the report document, but not sent to emitter yet.

Returns:
the on-finish script of the group

getOnRender

public java.lang.String getOnRender()
Gets the on-finish script of the group. Presentation phase. The report item has been read from the report document, but not sent to emitter yet.

Returns:
the on-finish script of the group

setOnPrepare

public void setOnPrepare(java.lang.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()

setOnCreate

public void setOnCreate(java.lang.String script)
                 throws SemanticException
Sets the on-create script of the group element.

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

setOnRender

public void setOnRender(java.lang.String script)
                 throws SemanticException
Sets the on-render script of the group element.

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

getEventHandleClass

public java.lang.String getEventHandleClass()
Gets a string that defines the event handle class.

Returns:
the expression as a string
See Also:
setEventHandleClass(String)

setEventHandleClass

public void setEventHandleClass(java.lang.String expr)
                         throws SemanticException
Sets the group expression.

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


Copyright © 2008 Actuate Corp. All rights reserved.