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

java.lang.Object
  extended byorg.eclipse.birt.report.model.api.DesignElementHandle
      extended byorg.eclipse.birt.report.model.api.ModuleHandle
          extended byorg.eclipse.birt.report.model.api.ReportDesignHandle
All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, IModuleModel, org.eclipse.birt.report.model.elements.interfaces.IReportDesignModel

public class ReportDesignHandle
extends ModuleHandle
implements org.eclipse.birt.report.model.elements.interfaces.IReportDesignModel

Represents the overall report design. The report design defines a set of properties that describe the design as a whole like author, base and comments etc.

Besides properties, it also contains a variety of elements that make up the report. These include:

Content Item Description
Code Modules Global scripts that apply to the report as a whole.
Parameters A list of Parameter elements that describe the data that the user can enter when running the report.
Data Sources The connections used by the report.
Data Sets Data sets defined in the design.
Color Palette A set of custom color names as part of the design.
Styles User-defined styles used to format elements in the report. Each style must have a unique name within the set of styles for this report.
Page Setup The layout of the master pages within the report.
Components Reusable report items defined in this design. Report items can extend these items. Defines a "private library" for this design.
Body A list of the visual report content. Content is made up of one or more sections. A section is a report item that fills the width of the page. It can contain Text, Grid, List, Table, etc. elements
Scratch Pad Temporary place to move report items while restructuring a report.
Translations The list of externalized messages specifically for this report.
Images A list of images embedded in this report.

Module allow to use the components defined in Library.

                    // Include one library
                    
                    ReportDesignHandle designHandle = ...;
                    designHandle.includeLibrary( "libA.rptlibrary", "LibA" );
                    LibraryHandle libraryHandle = designHandle.getLibrary("LibA");
                     
                    // Create one label based on the one in library
                   
                    LabelHandle labelHandle = (LabelHandle) libraryHandle.findElement("companyNameLabel");
                    LabelHandle myLabelHandle = (LabelHandle) designHandle.getElementFactory().newElementFrom( labelHandle, "myLabel" );
                   
                    // Add the new label into design file
                   
                    designHandle.getBody().add(myLabelHandle);
                 
 

See Also:
ReportDesign

Field Summary
 
Fields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
module
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IReportDesignModel
AFTER_CLOSE_DOC_METHOD, AFTER_FACTORY_METHOD, AFTER_OPEN_DOC_METHOD, AFTER_RENDER_METHOD, BEFORE_CLOSE_DOC_METHOD, BEFORE_FACTORY_METHOD, BEFORE_OPEN_DOC_METHOD, BEFORE_RENDER_METHOD, BODY_SLOT, CHEAT_SHEET_PROP, DATA_SOURCE_BINDINGS_PROP, ICON_FILE_PROP, REFRESH_RATE_PROP, SCRATCH_PAD_SLOT, SLOT_COUNT, STYLE_SLOT, TEMPLATE_PARAMETER_DEFINITION_SLOT
 
Fields inherited from interface org.eclipse.birt.report.model.api.core.IModuleModel
AUTHOR_PROP, BASE_PROP, COLOR_PALETTE_PROP, COMPONENT_SLOT, CONFIG_VARS_PROP, CREATED_BY_PROP, DATA_SET_SLOT, DATA_SOURCE_SLOT, DESCRIPTION_ID_PROP, DESCRIPTION_PROP, HELP_GUIDE_PROP, IMAGES_PROP, INCLUDE_RESOURCE_PROP, INCLUDE_SCRIPTS_PROP, INITIALIZE_METHOD, LIBRARIES_PROP, PAGE_SLOT, PARAMETER_SLOT, PROPERTY_BINDINGS_PROP, STYLE_SLOT, THEME_PROP, TITLE_ID_PROP, TITLE_PROP, UNITS_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
ReportDesignHandle(org.eclipse.birt.report.model.elements.ReportDesign design)
          Constructs a handle with the given design.
 
Method Summary
 java.util.Iterator dataSourceBindingsIterator()
          Returns the iterator over all data source bindings.
 java.lang.String getAfterCloseDoc()
          Deprecated.  
 java.lang.String getAfterFactory()
          Returns the script called at the end of the Factory after closing the report document (if any).
 java.lang.String getAfterOpenDoc()
          Deprecated.  
 java.lang.String getAfterRender()
          Returns the script called after starting a presentation time action.
 java.util.List getAllBookmarks()
          Gets all bookmarks defined in this module.
 java.lang.String getBase()
          Returns the base directory to use when computing relative links from this report.
 java.lang.String getBeforeCloseDoc()
          Deprecated.  
 java.lang.String getBeforeFactory()
          Returns the script called at the start of the Factory after the initialize( ) method and before opening the report document (if any).
 java.lang.String getBeforeOpenDoc()
          Deprecated.  
 java.lang.String getBeforeRender()
          Returns the script called before starting a presentation time action.
 SlotHandle getBody()
          Returns a slot handle to work with the sections in the report's Body slot.
 java.lang.String getCheatSheet()
          Gets the design cheat sheet file path.
 java.lang.String getCheetSheet()
          Deprecated. by getCheatSheet()
 java.lang.String getDisplayName()
          Gets the display name.
 java.lang.String getDisplayNameKey()
          Gets the resource key of the display name.
 java.lang.String getIconFile()
          Gets the design icon/thumbnail file path.
 int getRefreshRate()
          Returns the refresh rate when viewing the report.
 SlotHandle getScratchPad()
          Returns a slot handle to work with the scratched elements within the report, which are no longer needed or are in the process of rearranged.
 SlotHandle getStyles()
          Returns a slot handle to work with the styles within the report.
 void importCssStyles(CssStyleSheetHandle stylesheet, java.util.List selectedStyles)
          Imports the selected styles in a CssStyleSheetHandle to the module.
 java.util.Iterator includeScriptsIterator()
          Returns the iterator over all included scripts.
 void setAfterCloseDoc(java.lang.String value)
          Deprecated.  
 void setAfterFactory(java.lang.String value)
          Sets the script called at the end of the Factory after closing the report document (if any).
 void setAfterOpenDoc(java.lang.String value)
          Deprecated.  
 void setAfterRender(java.lang.String value)
          Sets the script called after starting a presentation time action.
 void setBase(java.lang.String base)
          Sets the base directory to use when computing relative links from this report.
 void setBeforeCloseDoc(java.lang.String value)
          Deprecated.  
 void setBeforeFactory(java.lang.String value)
          Sets the script called at the start of the Factory after the initialize( ) method and before opening the report document (if any).
 void setBeforeOpenDoc(java.lang.String value)
          Deprecated.  
 void setBeforeRender(java.lang.String value)
          Sets the script called before starting a presentation time action.
 void setCheatSheet(java.lang.String cheatSheet)
          Sets the design cheat sheet file path.
 void setCheetSheet(java.lang.String cheatSheet)
          Deprecated. by setCheatSheet(String)
 void setDisplayName(java.lang.String displayName)
          Sets the display name.
 void setDisplayNameKey(java.lang.String displayNameKey)
          Sets the resource key of the display name.
 void setIconFile(java.lang.String iconFile)
          Sets the design icon/thumbnail file path.
 void setRefreshRate(int rate)
          Sets the refresh rate when viewing the report.
 
Methods inherited from class org.eclipse.birt.report.model.api.ModuleHandle
addAttributeListener, addConfigVariable, addDisposeListener, addImage, addTranslation, addValidationListener, checkReport, close, configVariablesIterator, customColorsIterator, drop, dropAndClear, dropConfigVariable, dropImage, dropImage, dropLibrary, dropLibraryAndBreakExtends, dropTranslation, findCascadingParameterGroup, findColor, findConfigVariable, findDataSet, findDataSource, findElement, findImage, findMasterPage, findNativeStyle, findParameter, findResource, findStyle, findTemplateDataSet, findTheme, getAllDataSets, getAllDataSources, getAllImages, getAllLibraries, getAllPages, getAllParameters, getAllStyles, getAllThemes, getAuthor, getCommandStack, getComponents, getCreatedBy, getDataSets, getDataSources, getDefaultUnits, getDescription, getDescriptionKey, getDisplayDescription, getElement, getElementByID, getErrorList, getFileName, getFlattenParameters, getHelpGuide, getIncludeResource, getInitialize, getLibraries, getLibraries, getLibrary, getMasterPages, getMessage, getMessage, getMessageKeys, getParameters, getTheme, getTranslation, getTranslationKeys, getTranslations, getVisibleDataSets, getVisibleDataSources, getWarningList, imagesIterator, includeLibrariesIterator, includeLibrary, isInclude, isReadOnly, needsSave, onSave, openCssStyleSheet, openCssStyleSheet, removeAttributeListener, removeDisposeListener, removeValidationListener, rename, rename, replaceConfigVariable, replaceImage, save, saveAs, serialize, setAuthor, setCreatedBy, setDefaultUnits, setDescription, setDescriptionKey, setFileName, setHelpGuide, setIncludeResource, setInitialize, setTheme, setThemeName, shiftLibrary
 
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, 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

ReportDesignHandle

public ReportDesignHandle(org.eclipse.birt.report.model.elements.ReportDesign design)
Constructs a handle with the given design. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.

Parameters:
design - the report design
Method Detail

getAfterCloseDoc

public java.lang.String getAfterCloseDoc()
Deprecated.  

Returns the script called just after closing the report document file in the Factory.

Returns:
the script

getAfterFactory

public java.lang.String getAfterFactory()
Returns the script called at the end of the Factory after closing the report document (if any). This is the last method called in the Factory.

Returns:
the script

getAfterOpenDoc

public java.lang.String getAfterOpenDoc()
Deprecated.  

Returns the script called just after opening the report document in the Factory.

Returns:
the script

getAfterRender

public java.lang.String getAfterRender()
Returns the script called after starting a presentation time action.

Returns:
the script

getBase

public java.lang.String getBase()
Returns the base directory to use when computing relative links from this report. Especially used for searching images, library and so.

Returns:
the base directory

getBeforeCloseDoc

public java.lang.String getBeforeCloseDoc()
Deprecated.  

Returns the script called just before closing the report document file in the Factory.

Returns:
the script

getBeforeFactory

public java.lang.String getBeforeFactory()
Returns the script called at the start of the Factory after the initialize( ) method and before opening the report document (if any).

Returns:
the script

getBeforeOpenDoc

public java.lang.String getBeforeOpenDoc()
Deprecated.  

Returns the script called just before opening the report document in the Factory.

Returns:
the script

getBeforeRender

public java.lang.String getBeforeRender()
Returns the script called before starting a presentation time action.

Returns:
the script

getBody

public SlotHandle getBody()
Returns a slot handle to work with the sections in the report's Body slot. The order of sections within the slot determines the order in which the sections print.

Returns:
A handle for working with the report sections.

getRefreshRate

public int getRefreshRate()
Returns the refresh rate when viewing the report.

Returns:
the refresh rate

getScratchPad

public SlotHandle getScratchPad()
Returns a slot handle to work with the scratched elements within the report, which are no longer needed or are in the process of rearranged.

Returns:
A handle for working with the scratched elements.

includeScriptsIterator

public java.util.Iterator includeScriptsIterator()
Returns the iterator over all included scripts. Each one is the instance of IncludeScriptHandle

Returns:
the iterator over all included scripts.
See Also:
IncludeScriptHandle

dataSourceBindingsIterator

public java.util.Iterator dataSourceBindingsIterator()
Returns the iterator over all data source bindings. Each one is the instance of DataSourceParamBindingHandle

Returns:
the iterator over all data source bindings.
See Also:
DataSourceParamBindingHandle

setAfterCloseDoc

public void setAfterCloseDoc(java.lang.String value)
Deprecated.  

Sets the script called just after closing the report document file in the Factory.

Parameters:
value - the script to set.

setAfterFactory

public void setAfterFactory(java.lang.String value)
Sets the script called at the end of the Factory after closing the report document (if any). This is the last method called in the Factory.

Parameters:
value - the script to set.

setAfterOpenDoc

public void setAfterOpenDoc(java.lang.String value)
Deprecated.  

Sets the script called just after opening the report document in the Factory.

Parameters:
value - the script to set.

setAfterRender

public void setAfterRender(java.lang.String value)
Sets the script called after starting a presentation time action.

Parameters:
value - the script to set.

setBase

public void setBase(java.lang.String base)
Sets the base directory to use when computing relative links from this report. Especially used for searching images, library and so.

Parameters:
base - the base directory to set

setBeforeCloseDoc

public void setBeforeCloseDoc(java.lang.String value)
Deprecated.  

Sets the script called just before closing the report document file in the Factory.

Parameters:
value - the script to set.

setBeforeFactory

public void setBeforeFactory(java.lang.String value)
Sets the script called at the start of the Factory after the initialize( ) method and before opening the report document (if any).

Parameters:
value - the script to set.

setBeforeOpenDoc

public void setBeforeOpenDoc(java.lang.String value)
Deprecated.  

Sets the script called just before opening the report document in the Factory.

Parameters:
value - the script to set.

setBeforeRender

public void setBeforeRender(java.lang.String value)
Sets the script called before starting a presentation time action.

Parameters:
value - the script to set.

setRefreshRate

public void setRefreshRate(int rate)
Sets the refresh rate when viewing the report.

Parameters:
rate - the refresh rate

getStyles

public SlotHandle getStyles()
Returns a slot handle to work with the styles within the report. Note that the order of the styles within the slot is unimportant.

Overrides:
getStyles in class ModuleHandle
Returns:
A handle for working with the styles.

importCssStyles

public void importCssStyles(CssStyleSheetHandle stylesheet,
                            java.util.List selectedStyles)
Description copied from class: ModuleHandle
Imports the selected styles in a CssStyleSheetHandle to the module. Each in the list is instance of SharedStyleHandle .If any style selected has a duplicate name with that of one style already existing in the report design, this method will rename it and then add it to the design.

Specified by:
importCssStyles in class ModuleHandle
Parameters:
stylesheet - the style sheet handle that contains all the selected styles
selectedStyles - the selected style list

setDisplayNameKey

public void setDisplayNameKey(java.lang.String displayNameKey)
                       throws SemanticException
Sets the resource key of the display name.

Parameters:
displayNameKey - the resource key of the display name
Throws:
SemanticException - if the display name resource-key property is locked or not defined on this design.

getDisplayNameKey

public java.lang.String getDisplayNameKey()
Gets the resource key of the display name.

Returns:
the resource key of the display name

setDisplayName

public void setDisplayName(java.lang.String displayName)
                    throws SemanticException
Sets the display name.

Parameters:
displayName - the display name
Throws:
SemanticException - if the display name property is locked or not defined on this design.

getDisplayName

public java.lang.String getDisplayName()
Gets the display name.

Returns:
the display name

setIconFile

public void setIconFile(java.lang.String iconFile)
                 throws SemanticException
Sets the design icon/thumbnail file path.

Parameters:
iconFile - the design icon/thumbnail file path to set
Throws:
SemanticException - if the property is locked or not defined on this design.

getIconFile

public java.lang.String getIconFile()
Gets the design icon/thumbnail file path.

Returns:
the design icon/thumbnail file path

setCheetSheet

public void setCheetSheet(java.lang.String cheatSheet)
                   throws SemanticException
Deprecated. by setCheatSheet(String)

Sets the design cheat sheet file path.

Parameters:
cheatSheet - the design cheat sheet file path to set
Throws:
SemanticException - if the property is locked or not defined on this design.

setCheatSheet

public void setCheatSheet(java.lang.String cheatSheet)
                   throws SemanticException
Sets the design cheat sheet file path.

Parameters:
cheatSheet - the design cheat sheet file path to set
Throws:
SemanticException - if the property is locked or not defined on this design.

getCheetSheet

public java.lang.String getCheetSheet()
Deprecated. by getCheatSheet()

Gets the design cheat sheet file path.

Returns:
the design cheat sheet file path

getCheatSheet

public java.lang.String getCheatSheet()
Gets the design cheat sheet file path.

Returns:
the design cheat sheet file path

getAllBookmarks

public java.util.List getAllBookmarks()
Description copied from class: ModuleHandle
Gets all bookmarks defined in this module.

Specified by:
getAllBookmarks in class ModuleHandle
Returns:
All bookmarks defined in this module.


Copyright © 2005 Actuate Corp. All rights reserved.