Class ModuleHandleImpl
- java.lang.Object
-
- org.eclipse.birt.report.model.api.DesignElementHandle
-
- org.eclipse.birt.report.model.api.ModuleHandleImpl
-
- All Implemented Interfaces:
IModuleModel,org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
- Direct Known Subclasses:
ModuleHandle
public abstract class ModuleHandleImpl extends DesignElementHandle implements IModuleModel
Abstract module handle which provides the common functionalities of report design and library.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. Translations The list of externalized messages specifically for this report. Images A list of images embedded in this report.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisInitializedThe flag indicates that whether the initialization is finished.-
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.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, SCRIPTLIBS_PROP, SUBJECT_PROP, THEME_PROP, TITLE_ID_PROP, TITLE_PROP, UNITS_PROP
-
-
Constructor Summary
Constructors Constructor Description ModuleHandleImpl(org.eclipse.birt.report.model.core.Module module)Constructs one module handle with the given module element.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAttributeListener(IAttributeListener listener)Adds one attribute listener.voidaddConfigVariable(ConfigVariable configVar)Adds a new config variable.voidaddDisposeListener(IDisposeListener listener)Adds one dispose listener.voidaddImage(EmbeddedImage image)Adds a new embedded image.voidaddIncludeScript(IncludeScript includeScript)Adds include script.voidaddResourceChangeListener(IResourceChangeListener listener)Adds one resource change listener.voidaddScriptLib(ScriptLib scriptLib)Add script libvoidaddTranslation(java.lang.String resourceKey, java.lang.String locale, java.lang.String text)Adds a new translation to the design.voidaddValidationListener(IValidationListener listener)Adds the validation listener, which implementsIValidationListener.voidcheckReport()Checks this whole report.voidcheckReportIfNecessary()Checks the report if it is set in options.voidclose()Closes the design.java.util.IteratorconfigVariablesIterator()Returns the iterator over all configuration variables.IDesignElementcopy()Deeply clones the current design element which is wrapped by the handle.java.util.IteratorcustomColorsIterator()Returns the iterator over all structures of color palette.voiddrop()Drops this element from the design.voiddropAllScriptLibs()Removes all script libs.voiddropAndClear()Drops this element from the design.voiddropConfigVariable(java.lang.String name)Deprecated.voiddropImage(java.lang.String name)Deprecated.voiddropImage(java.util.List images)Drops an embedded image handle list from the design.voiddropIncludeScript(IncludeScript includeScript)Removes the given included script.voiddropLibrary(LibraryHandle library)Drops the given library from the included libraries of this design file.voiddropLibraryAndBreakExtends(LibraryHandle library)Drops the given library from the design and break all the parent/child relationships.voiddropScriptLib(ScriptLib scriptLib)Removes special script lib.voiddropScriptLib(ScriptLibHandle scriptLibHandle)Removes special script lib handle.voiddropTranslation(java.lang.String resourceKey, java.lang.String locale)Drops a translation from the design.CascadingParameterGroupHandlefindCascadingParameterGroup(java.lang.String groupName)Returns a cascading parameter group handle with the given group nameCustomColorfindColor(java.lang.String name)Finds the custom color with the given name.ConfigVariablefindConfigVariable(java.lang.String name)Finds the config variable with the given name.CubeHandlefindCube(java.lang.String name)Finds a cube element by name in this module and the included modules.DataSetHandlefindDataSet(java.lang.String name)Finds a data set by name in this module and the included modules.DataSourceHandlefindDataSource(java.lang.String name)Finds a data source by name in this module and the included modules.DimensionHandlefindDimension(java.lang.String name)Finds a dimension element by name in this module and the included modules.DesignElementHandlefindElement(java.lang.String name)Finds a named element in the name space in this module and the included moduled.EmbeddedImagefindImage(java.lang.String name)Finds the image with the given name.JointDataSetHandlefindJointDataSet(java.lang.String name)Finds a joint data set by name in this module and the included modules.LevelHandlefindLevel(java.lang.String name)Finds a cube element by name in this module and the included modules.LibraryHandlefindLibrary(java.lang.String fileName)Returns the library handle with the given file name.MasterPageHandlefindMasterPage(java.lang.String name)Finds a master page by name in this module and the included modules.SharedStyleHandlefindNativeStyle(java.lang.String name)Finds a style by its name in this module.ParameterHandlefindParameter(java.lang.String name)Finds a parameter by name in this module and the included modules.ReportItemThemeHandlefindReportItemTheme(java.lang.String name)Finds a report item theme by its name in this module and its included libraries.java.net.URLfindResource(java.lang.String fileName, int fileType)Returns theURLobject if the file withfileNameexists.java.net.URLfindResource(java.lang.String fileName, int fileType, java.util.Map appContext)Returns theURLobject if the file withfileNameexists.ScriptLibfindScriptLib(java.lang.String name)Gets script lib though nameSharedStyleHandlefindStyle(java.lang.String name)Finds a style by its name in this module and the included modules.TemplateDataSetHandlefindTemplateDataSet(java.lang.String name)Finds a template data set by name in this module and the included modules.ThemeHandlefindTheme(java.lang.String name)Finds a theme by its name in this module and the included modules.protected java.util.ListgenerateHandleList(java.util.List elementList)Generates a list of element handles according to the given element list.java.util.ListgetAllCubes()Returns all cube handles that this modules and the included modules contain.java.util.ListgetAllDataSets()Returns all data set handles that this modules and the included modules contain.java.util.ListgetAllDataSources()Returns all data source handles that this modules and the included modules contain.java.util.ListgetAllImages()Returns the list of embedded images, including the one from libraries.java.util.ListgetAllIncludeScripts()Gets all included scripts.java.util.ListgetAllLibraries()Returns the libraries this report design includes directly or indirectly.java.util.ListgetAllPages()Returns all page handles that this modules and the included modules contain.java.util.ListgetAllParameters()Returns all parameter handles that this modules.java.util.ListgetAllScriptLibs()Returns all script libs.java.util.List<DimensionHandle>getAllSharedDimensions()Gets all the shared dimensions defined or accessed by this module.java.util.ListgetAllStyles()Returns all style element handles that this modules and the included modules contain.java.lang.StringgetAuthor()Returns the name of the author of the design report.CommandStackgetCommandStack()Returns the command stack that manages undo/redo operations for the design.java.lang.StringgetComments()Gets comments property value.SlotHandlegetComponents()Returns a slot handle to work with the top-level components within the report.java.lang.StringgetCreatedBy()Returns the name of the tool that created the design.abstract SlotHandlegetCubes()Gets the slot handle to work with all cube elements within the report.SlotHandlegetDataSets()Returns a slot handle to work with the data sets within the report.SlotHandlegetDataSources()Returns a slot handle to work with the data sources within the report.java.lang.StringgetDefaultUnits()Returns the default units for the design.java.lang.StringgetDescription()Returns the static description for the module.java.lang.StringgetDescriptionKey()Returns the resource key of the static description of the module.java.lang.StringgetDisplayDescription()Returns the localized description for the module.org.eclipse.birt.report.model.core.DesignElementgetElement()Returns the element to which this handle is attached.DesignElementHandlegetElementByID(long id)Finds the handle to an element by a given element ID.java.util.ListgetErrorList()Returns a list containing errors during parsing the design file.java.lang.StringgetFileEncoding()Returns the encoding of the design/library file.java.lang.StringgetFileName()Returns the file name of the design.java.util.ListgetFlattenParameters()Returns the flatten Parameters/ParameterGroups of the design.java.lang.StringgetHelpGuide()Returns an external file that provides help information for the report.java.lang.StringgetIncludeResource()Get the base name of the customer-defined resource bundle.java.util.List<java.lang.String>getIncludeResources()java.lang.StringgetInitialize()Returns the script called when the report starts executing.java.util.ListgetLibraries()Returns the libraries this report design includes directly.protected java.util.ListgetLibraries(int level)Returns included libaries this report design includes directly or indirectly within the given depth.LibraryHandlegetLibrary(java.lang.String namespace)Returns the library handle with the given namespace.intgetLineNo(java.lang.Object obj)looks up line number of the element\property\structure, in xml source with given xPaht.intgetLineNoByID(long id)Deprecated.new method seegetLineNo(Object)SlotHandlegetMasterPages()Returns a slot handle to work with the master pages within the report.java.lang.StringgetMessage(java.lang.String resourceKey)Finds user-defined messages for the current thread's locale.java.lang.StringgetMessage(java.lang.String resourceKey, com.ibm.icu.util.ULocale locale)Finds user-defined messages for the given locale.java.lang.StringgetMessage(java.lang.String resourceKey, java.util.Locale locale)Finds user-defined messages for the given locale.java.util.ListgetMessageKeys()Return a list of user-defined message keys.protected java.util.ListgetNativeStructureList(java.lang.String propName)Returns the structures which are defined locally in the current module.java.util.MapgetOptions()Gets the options set in the module.SlotHandlegetParameters()Returns a slot handle to work with the top-level parameters and parameter groups within the report.java.util.ListgetParametersAndParameterGroups()Returns parameters and parameter groups on the module.java.lang.StringgetResourceFolder()Gets the resource folder set in this module.SlotHandlegetStyles()Returns a slot handle to work with the styles within the report.java.lang.StringgetSubject()Gets the subject of the module.java.lang.StringgetSymbolicName()Gets symbolic name of this module if defined.java.net.URLgetSystemId()Returns the system id of the module.ThemeHandlegetTheme()Returns the refresh rate when viewing the report.java.lang.StringgetTitle()Gets the title property value.java.lang.StringgetTitleKey()Gets the title key.TranslationHandlegetTranslation(java.lang.String resourceKey, java.lang.String locale)Gets a handle to deal with a translation.java.lang.String[]getTranslationKeys()Returns a string array containing all the resource keys of user-defined translations for the report.java.util.ListgetTranslations()Gets a list of translation defined on the report.java.lang.StringgetVersion()Returns the version for the opened design file.java.util.ListgetVisibleCubes()Returns cube handles that are visible to this modules.java.util.ListgetVisibleDataSets()Returns data set handles that are visible to this modules.java.util.ListgetVisibleDataSources()Returns data source handles that are visible to this modules.java.util.ListgetVisibleImages()Returns the embedded images which are defined on the module itself.protected java.util.List<ModuleHandleImpl>getVisibleModules(int level)Gets the visible modules.java.util.List<ReportItemThemeHandle>getVisibleReportItemThemes(int level, java.lang.String type)Returns report item theme handles according the input level.java.util.ListgetVisibleThemes(int level)Returns theme handles according the input level.java.util.ListgetWarningList()Returns a list containing warnings during parsing the design file.java.util.IteratorimagesIterator()Returns the iterator over all embedded images of this module instance.voidimportCssStyles(CssStyleSheetHandle stylesheet, java.util.List selectedStyles)Imports the selected styles in aCssStyleSheetHandleto the module.java.util.IteratorincludeLibrariesIterator()Returns the iterator over all included libraries.voidincludeLibrary(java.lang.String libraryFileName, java.lang.String namespace)Includes one library with the given library file name.java.util.IteratorincludeScriptsIterator()Returns the iterator over all included scripts.voidinitializeModule(java.util.Map properties)Initializes the report design when it is just created.booleanisInclude(LibraryHandle library)Checks whether there is an included library in this module, which has the same absolute path as that of the given library.booleanisReadOnly()Returns whether this module is read-only.booleanneedsSave()Determines if the design has changed since it was last read from, or written to, the file.voidonSave()Calls to inform a save is successful.CssStyleSheetHandleopenCssStyleSheet(java.io.InputStream is)Gets the result style sheet with given file name of an external CSS2 resource.CssStyleSheetHandleopenCssStyleSheet(java.lang.String fileName)Gets the result style sheet with given file name of an external CSS2 resource.voidreloadLibraries()Reloads all libraries this module included.voidreloadLibrary(java.lang.String reloadPath)Reloads the library with the given library file path.voidreloadLibrary(LibraryHandle libraryToReload)Reloads the library with the given library file path.booleanremoveAttributeListener(IAttributeListener listener)Removes one attribute listener.booleanremoveDisposeListener(IDisposeListener listener)Removes one dispose listener.booleanremoveResourceChangeListener(IResourceChangeListener listener)Removes one resource change listener.booleanremoveValidationListener(IValidationListener listener)Removes a given validation listener.voidrename(DesignElementHandle elementHandle)Checks the element name in name space of this report.voidrename(DesignElementHandle containerHandle, DesignElementHandle elementHandle)Checks element name is unique in container.voidrename(EmbeddedImage image)Checks the name of the embedded image in this report.voidreplaceConfigVariable(ConfigVariable oldVar, ConfigVariable newVar)Replaces the old config variable with the new one.voidreplaceImage(EmbeddedImage oldVar, EmbeddedImage newVar)Replaces the old embedded image with the new one.voidsave()Saves the module to an existing file name.voidsaveAs(java.lang.String newName)Saves the design to the file name provided.java.util.IteratorscriptLibsIterator()Returns the iterator over all script libs.voidserialize(java.io.OutputStream out)Writes the report design to the given output stream.voidsetAuthor(java.lang.String author)Sets the name of the author of the design report.voidsetComments(java.lang.String comments)Sets the comments value.voidsetCreatedBy(java.lang.String toolName)Returns the name of the tool that created the design.voidsetDefaultUnits(java.lang.String units)Sets the default units for the design.voidsetDescription(java.lang.String description)Sets the description of the module.voidsetDescriptionKey(java.lang.String resourceKey)Sets the resource key of the static description of the module.voidsetFileName(java.lang.String newName)Sets the design file name.voidsetHelpGuide(java.lang.String helpGuide)Sets an external file that provides help information for the report.voidsetIncludeResource(java.lang.String baseName)Set the base name of the customer-defined resource bundle.voidsetIncludeResources(java.util.List<java.lang.String> baseNameList)Set the list of base name of the customer-defined resource bundles.voidsetInitialize(java.lang.String value)Sets the script called when the report starts executing.voidsetOptions(java.util.Map options)Sets options to the module.voidsetResourceFolder(java.lang.String resourceFolder)Sets the resource folder for this module.voidsetSubject(java.lang.String subject)Sets the subject of the module.voidsetSymbolicName(java.lang.String symbolicName)Sets symbolic name of this module.voidsetTheme(ThemeHandle theme)Sets the theme to a report.voidsetThemeName(java.lang.String themeName)Sets the theme to a report.voidsetTitle(java.lang.String title)Sets the title value.voidsetTitleKey(java.lang.String titleKey)Sets the title key.voidshifIncludeScripts(int sourceIndex, int destIndex)Shifts included script from source position to destination position.voidshiftLibrary(LibraryHandle library, int toPosn)Shifts the library to new position.voidshiftScriptLibs(int sourceIndex, int destIndex)Shifts jar file from source position to destination position.protected java.util.ListsortVisibleElements(java.util.List nameSpaceList, int level)Sorts visible elements.-
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, copyPropertyTo, createTemplateElement, derivedIterator, doSort, drop, drop, 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, getProperty, 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
-
-
-
-
Method Detail
-
addConfigVariable
public void addConfigVariable(ConfigVariable configVar) throws SemanticException
Adds a new config variable.- Parameters:
configVar- the config variable- Throws:
SemanticException- if the name is empty or the same name exists.
-
addImage
public void addImage(EmbeddedImage image) throws SemanticException
Adds a new embedded image.- Parameters:
image- the image to add- Throws:
SemanticException- if the name is empty, type is invalid, or the same name exists.
-
rename
public final void rename(EmbeddedImage image)
Checks the name of the embedded image in this report. If duplicate, get a unique name and rename it.- Parameters:
image- the embedded image whose name is need to check
-
addTranslation
public void addTranslation(java.lang.String resourceKey, java.lang.String locale, java.lang.String text) throws CustomMsgExceptionAdds a new translation to the design.- Parameters:
resourceKey- resource key for the messagelocale- the string value of a locale for the translation. Locale should be in java-defined format( en, en-US, zh_CN, etc.)text- translated text for the locale- Throws:
CustomMsgException- if the resource key is duplicate or missing, or locale is not a valid format.- See Also:
getTranslation(String, String)
-
addValidationListener
public final void addValidationListener(IValidationListener listener)
Adds the validation listener, which implementsIValidationListener. A listener receives notifications each time an element is validated.- Parameters:
listener- the validation listener.
-
checkReport
public final void checkReport()
Checks this whole report. Only oneValidationEventwill be sent, which contains all error information of this check.
-
close
public final void close()
Closes the design. The report design handle is no longer valid after closing the design. This method will send notifications instance ofDisposeEventto all the dispose listeners registered in the module.
-
getNativeStructureList
protected final java.util.List getNativeStructureList(java.lang.String propName)
Returns the structures which are defined locally in the current module. This method will collect all structures from the current module file locally.- Parameters:
propName- name of the list property- Returns:
- the structure list, each of which is the instance of
StructureHandle
-
configVariablesIterator
public final java.util.Iterator configVariablesIterator()
Returns the iterator over all configuration variables. Each one is the instance ofConfigVariableHandle.Note: The configure variable in library file will be hidden if the one with the same name appears in design file.
- Returns:
- the iterator over all configuration variables.
- See Also:
ConfigVariableHandle
-
customColorsIterator
public final java.util.Iterator customColorsIterator()
Returns the iterator over all structures of color palette. Each one is the instance ofCustomColorHandle- Returns:
- the iterator over all structures of color palette.
- See Also:
CustomColorHandle
-
dropConfigVariable
@Deprecated public void dropConfigVariable(java.lang.String name) throws SemanticExceptionDeprecated.Drops a config variable.- Parameters:
name- config variable name- Throws:
SemanticException- if no config variable is found.
-
dropImage
public void dropImage(java.util.List images) throws SemanticExceptionDrops an embedded image handle list from the design. Each one in the list is the instance ofEmbeddedImageHandle.- Parameters:
images- the image handle list to remove- Throws:
SemanticException- if any image in the list is not found.
-
dropImage
@Deprecated public void dropImage(java.lang.String name) throws SemanticExceptionDeprecated.Drops an embedded image from the design.- Parameters:
name- the image name- Throws:
SemanticException- if the image is not found.
-
dropTranslation
public void dropTranslation(java.lang.String resourceKey, java.lang.String locale) throws CustomMsgExceptionDrops a translation from the design.- Parameters:
resourceKey- resource key of the message in which this translation saves.locale- the string value of the locale for a translation. Locale should be in java-defined format( en, en-US, zh_CN, etc.)- Throws:
CustomMsgException- ifresourceKeyisnull.- See Also:
getTranslation(String, String)
-
findDataSet
public final DataSetHandle findDataSet(java.lang.String name)
Finds a data set by name in this module and the included modules.- Parameters:
name- name of the data set- Returns:
- a handle to the data set, or
nullif the data set is not found
-
findJointDataSet
public final JointDataSetHandle findJointDataSet(java.lang.String name)
Finds a joint data set by name in this module and the included modules.- Parameters:
name- name of the joint data set- Returns:
- a handle to the joint data set, or
nullif the data set is not found
-
findTemplateDataSet
public final TemplateDataSetHandle findTemplateDataSet(java.lang.String name)
Finds a template data set by name in this module and the included modules.- Parameters:
name- name of the data set- Returns:
- a handle to the template data set, or
nullif the data set is not found
-
findDataSource
public final DataSourceHandle findDataSource(java.lang.String name)
Finds a data source by name in this module and the included modules.- Parameters:
name- name of the data source- Returns:
- a handle to the data source, or
nullif the data source is not found
-
findElement
public final DesignElementHandle findElement(java.lang.String name)
Finds a named element in the name space in this module and the included moduled.- Parameters:
name- the name of the element to find- Returns:
- a handle to the element, or
nullif the element was not found.
-
findCube
public final CubeHandle findCube(java.lang.String name)
Finds a cube element by name in this module and the included modules.- Parameters:
name- the element name- Returns:
- the cube element handle, if found, otherwise null
-
findLevel
public final LevelHandle findLevel(java.lang.String name)
Finds a cube element by name in this module and the included modules.- Parameters:
name- the element name, name must be Dimension name + "/" + level name.- Returns:
- the cube element handle, if found, otherwise null
-
findDimension
public final DimensionHandle findDimension(java.lang.String name)
Finds a dimension element by name in this module and the included modules.- Parameters:
name- name of the dimension to find- Returns:
- the dimension handle if found, otherwise null
-
findImage
public final EmbeddedImage findImage(java.lang.String name)
Finds the image with the given name.- Parameters:
name- the image name- Returns:
- embedded image with the given name. Return
null, if not found.
-
findConfigVariable
public final ConfigVariable findConfigVariable(java.lang.String name)
Finds the config variable with the given name.- Parameters:
name- the variable name- Returns:
- the config variable with the given name. Return
null, if not found.
-
findColor
public final CustomColor findColor(java.lang.String name)
Finds the custom color with the given name.- Parameters:
name- the color name- Returns:
- the custom color with the given name. Return
nullif it's not found.
-
findMasterPage
public final MasterPageHandle findMasterPage(java.lang.String name)
Finds a master page by name in this module and the included modules.- Parameters:
name- the name of the master page- Returns:
- a handle to the master page, or
nullif the page is not found
-
findParameter
public final ParameterHandle findParameter(java.lang.String name)
Finds a parameter by name in this module and the included modules.- Parameters:
name- the name of the parameter- Returns:
- a handle to the parameter, or
nullif the parameter is not found
-
findNativeStyle
public final SharedStyleHandle findNativeStyle(java.lang.String name)
Finds a style by its name in this module. The style with the same name, which is defined the included module, will never be returned.- Parameters:
name- name of the style- Returns:
- a handle to the style, or
nullif the style is not found
-
findStyle
public final SharedStyleHandle findStyle(java.lang.String name)
Finds a style by its name in this module and the included modules.- Parameters:
name- name of the style- Returns:
- a handle to the style, or
nullif the style is not found
-
findTheme
public final ThemeHandle findTheme(java.lang.String name)
Finds a theme by its name in this module and the included modules.- Parameters:
name- name of the theme- Returns:
- a handle to the theme, or
nullif the theme is not found
-
findReportItemTheme
public final ReportItemThemeHandle findReportItemTheme(java.lang.String name)
Finds a report item theme by its name in this module and its included libraries.- Parameters:
name- name of the report item theme- Returns:
- a handle to the report item theme, or null if not found
-
getAuthor
public final java.lang.String getAuthor()
Returns the name of the author of the design report.- Returns:
- the name of the author.
-
getSubject
public final java.lang.String getSubject()
Gets the subject of the module.- Returns:
- the subject of the module.
-
setSubject
public final void setSubject(java.lang.String subject) throws SemanticExceptionSets the subject of the module.- Parameters:
subject- the subject of the module.- Throws:
SemanticException
-
getComments
public final java.lang.String getComments()
Gets comments property value.- Returns:
- the comments property value.
-
setComments
public final void setComments(java.lang.String comments) throws SemanticExceptionSets the comments value.- Parameters:
comments- the comments.- Throws:
SemanticException
-
getCommandStack
public final CommandStack getCommandStack()
Returns the command stack that manages undo/redo operations for the design.- Returns:
- a command stack
- See Also:
CommandStack
-
getComponents
public SlotHandle getComponents()
Returns a slot handle to work with the top-level components within the report.- Returns:
- A handle for working with the components.
-
getCreatedBy
public final java.lang.String getCreatedBy()
Returns the name of the tool that created the design.- Returns:
- the name of the tool
-
getDataSets
public SlotHandle getDataSets()
Returns a slot handle to work with the data sets within the report. Note that the order of the data sets within the slot is unimportant.- Returns:
- A handle for working with the data sets.
-
getCubes
public abstract SlotHandle getCubes()
Gets the slot handle to work with all cube elements within the report.- Returns:
- cube slot handle
-
getDataSources
public SlotHandle getDataSources()
Returns a slot handle to work with the data sources within the report. Note that the order of the data sources within the slot is unimportant.- Returns:
- A handle for working with the data sources.
-
getDefaultUnits
public final java.lang.String getDefaultUnits()
Returns the default units for the design. These are the units that are used for dimensions that don't explicitly specify units.- Returns:
- the default units for the design.
- See Also:
DimensionValue
-
setDefaultUnits
public final void setDefaultUnits(java.lang.String units) throws SemanticExceptionSets the default units for the design. These are the units that are used for dimensions that don't explicitly specify units.For a report design, it allows the following constants that defined in
:DesignChoiceConstantsUNITS_INUNITS_CMUNITS_MMUNITS_PT
- Parameters:
units- the default units for the design.- Throws:
SemanticException- if the input unit is not one of allowed.- See Also:
DimensionValue
-
getElement
public final org.eclipse.birt.report.model.core.DesignElement getElement()
Description copied from class:DesignElementHandleReturns the element to which this handle is attached.- Specified by:
getElementin classDesignElementHandle- Returns:
- The attached element. Will be null if the handle is not attached.
-
getElementByID
public final DesignElementHandle getElementByID(long id)
Finds the handle to an element by a given element ID. Returnsnullif the ID is not valid, or if this session does not use IDs.- Parameters:
id- ID of the element to find- Returns:
- A handle to the element, or
nullif the element was not found or this session does not use IDs.
-
getErrorList
public final java.util.List getErrorList()
Returns a list containing errors during parsing the design file.- Returns:
- a list containing parsing errors. Each element in the list is
ErrorDetail. - See Also:
ErrorDetail
-
getFileName
public final java.lang.String getFileName()
Returns the file name of the design. This is the name of the file from which the design was read, or the name to which the design was last written.- Returns:
- the file name
-
getFlattenParameters
public java.util.List getFlattenParameters()
Returns the flatten Parameters/ParameterGroups of the design. This method put all Parameters and ParameterGroups into a list then return it. The return list is sorted by on the display name of the parameters.- Returns:
- the sorted, flatten parameters and parameter groups.
-
getHelpGuide
public final java.lang.String getHelpGuide()
Returns an external file that provides help information for the report.- Returns:
- the name of an external file
-
getInitialize
public final java.lang.String getInitialize()
Returns the script called when the report starts executing.- Returns:
- the script called when the report starts executing
-
getMasterPages
public SlotHandle getMasterPages()
Returns a slot handle to work with the master pages within the report. Note that the order of the master pages within the slot is unimportant.- Returns:
- A handle for working with the master pages.
-
getMessage
public final java.lang.String getMessage(java.lang.String resourceKey)
Finds user-defined messages for the current thread's locale.- Parameters:
resourceKey- Resource key of the user-defined message.- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank. - See Also:
getMessage(String, Locale)
-
getMessage
public final java.lang.String getMessage(java.lang.String resourceKey, java.util.Locale locale)Finds user-defined messages for the given locale.First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
resourceKey- Resource key of the user defined message.locale- locale of message, if the inputlocaleisnull, the locale for the current thread will be used instead.- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getMessage
public final java.lang.String getMessage(java.lang.String resourceKey, com.ibm.icu.util.ULocale locale)Finds user-defined messages for the given locale.First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
resourceKey- Resource key of the user defined message.locale- locale of message, if the inputlocaleisnull, the locale for the current thread will be used instead.- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getMessageKeys
public final java.util.List getMessageKeys()
Return a list of user-defined message keys. The list contained resource keys defined in the report itself and the keys defined in the referenced message files for the current thread's locale. The list returned contains no duplicate keys.- Returns:
- a list of user-defined message keys.
-
getParameters
public SlotHandle getParameters()
Returns a slot handle to work with the top-level parameters and parameter groups within the report. The order that the items appear within the slot determines the order in which they appear in the "requester" UI.- Returns:
- A handle for working with the parameters and parameter groups.
-
findCascadingParameterGroup
public final CascadingParameterGroupHandle findCascadingParameterGroup(java.lang.String groupName)
Returns a cascading parameter group handle with the given group name- Parameters:
groupName- name of the cascading parameter group.- Returns:
- a handle to the cascading parameter group. Returns
nullif the cascading group with the given name is not found.
-
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.- Returns:
- A handle for working with the styles.
-
getTranslation
public final TranslationHandle getTranslation(java.lang.String resourceKey, java.lang.String locale)
Gets a handle to deal with a translation. A translation is identified by its resourceKey and locale.- Parameters:
resourceKey- the resource keylocale- the locale information- Returns:
- corresponding
TranslationHandle. Or returnnullif the translation is not found in the design. - See Also:
TranslationHandle
-
getTranslationKeys
public final java.lang.String[] getTranslationKeys()
Returns a string array containing all the resource keys of user-defined translations for the report.- Returns:
- a string array containing message resource keys, return
nullif there is no messages defined in the design.
-
getTranslations
public final java.util.List getTranslations()
Gets a list of translation defined on the report. The content of the list is the correspondingTranslationHandle.- Returns:
- a list containing TranslationHandles defined on the report or
nullif the design has no any translations. - See Also:
TranslationHandle
-
getWarningList
public final java.util.List getWarningList()
Returns a list containing warnings during parsing the design file.- Returns:
- a list containing parsing warnings. Each element in the list is
ErrorDetail. - See Also:
ErrorDetail
-
imagesIterator
public java.util.Iterator imagesIterator()
Returns the iterator over all embedded images of this module instance. Each one is the instance ofEmbeddedImageHandle- Returns:
- the iterator over all embedded images.
- See Also:
EmbeddedImageHandle
-
getAllImages
public final java.util.List getAllImages()
Returns the list of embedded images, including the one from libraries. Each one is the instance ofEmbeddedImageHandle- Returns:
- the list of embedded images.
- See Also:
EmbeddedImageHandle
-
needsSave
public final boolean needsSave()
Determines if the design has changed since it was last read from, or written to, the file. The dirty state reflects the action of the command stack. If the user saves the design and then changes it, the design is dirty. If the user then undoes the change, the design is no longer dirty.- Returns:
trueif the design has changed since the last load or save;falseif it has not changed.
-
onSave
public final void onSave()
Calls to inform a save is successful. Must be called after a successful completion of a save done usingserialize.
-
removeValidationListener
public final boolean removeValidationListener(IValidationListener listener)
Removes a given validation listener. If the listener not registered, then the request is silently ignored.- Parameters:
listener- the listener to de-register- Returns:
trueiflisteneris sucessfully removed. Otherwisefalse.
-
rename
public final void rename(DesignElementHandle elementHandle)
Checks the element name in name space of this report.- If the element name is required and duplicate name is found in name space, rename the element with a new unique name.
- If the element name is not required, clear the name.
- Parameters:
elementHandle- the element handle whose name is need to check.
-
rename
public void rename(DesignElementHandle containerHandle, DesignElementHandle elementHandle)
Checks element name is unique in container.- Parameters:
containerHandle- container of elementelementHandle- element handle
-
replaceConfigVariable
public void replaceConfigVariable(ConfigVariable oldVar, ConfigVariable newVar) throws SemanticException
Replaces the old config variable with the new one.- Parameters:
oldVar- the old config variablenewVar- the new config variable- Throws:
SemanticException- if the old config variable is not found or the name of new one is empty.
-
replaceImage
public void replaceImage(EmbeddedImage oldVar, EmbeddedImage newVar) throws SemanticException
Replaces the old embedded image with the new one.- Parameters:
oldVar- the old embedded imagenewVar- the new embedded image- Throws:
SemanticException- if the old image is not found or the name of new one is empty.
-
save
public final void save() throws java.io.IOExceptionSaves the module to an existing file name. Call this only when the file name has been set.- Throws:
java.io.IOException- if the file cannot be saved on the storage- See Also:
saveAs(String)
-
saveAs
public final void saveAs(java.lang.String newName) throws java.io.IOExceptionSaves the design to the file name provided. The file name is saved in the design, and subsequent calls tosave( )will save to this new name.- Parameters:
newName- the new file name- Throws:
java.io.IOException- if the file cannot be saved- See Also:
save()
-
serialize
public final void serialize(java.io.OutputStream out) throws java.io.IOExceptionWrites the report design to the given output stream. The caller must callonSaveif the save succeeds.- Parameters:
out- the output stream to which the design is written.- Throws:
java.io.IOException- if the file cannot be written to the output stream successfully.
-
setAuthor
public final void setAuthor(java.lang.String author)
Sets the name of the author of the design report.- Parameters:
author- the name of the author.
-
setCreatedBy
public final void setCreatedBy(java.lang.String toolName)
Returns the name of the tool that created the design.- Parameters:
toolName- the name of the tool
-
setFileName
public final void setFileName(java.lang.String newName)
Sets the design file name. This method will send notifications instance ofAttributeEventto all the attribute listeners registered in the module.- Parameters:
newName- the new file name. It may contain the relative/absolute path information. This name must include the file name with the filename extension.
-
setHelpGuide
public final void setHelpGuide(java.lang.String helpGuide)
Sets an external file that provides help information for the report.- Parameters:
helpGuide- the name of an external file
-
setInitialize
public final void setInitialize(java.lang.String value)
Sets the script called when the report starts executing.- Parameters:
value- the script to set.
-
getAllStyles
public java.util.List getAllStyles()
Returns all style element handles that this modules and the included modules contain.- Returns:
- all style element handles that this modules and the included modules contain.
-
getVisibleThemes
public java.util.List getVisibleThemes(int level)
Returns theme handles according the input level.- Parameters:
level- anintvalue, which should be the one defined inIVisibleLevelControl.- Returns:
- theme handles according the input level
-
getVisibleReportItemThemes
public java.util.List<ReportItemThemeHandle> getVisibleReportItemThemes(int level, java.lang.String type)
Returns report item theme handles according the input level.- Parameters:
level- anintvalue, which should be the one defined inIVisibleLevelControl.- Returns:
- theme handles according the input level
-
getParametersAndParameterGroups
public java.util.List getParametersAndParameterGroups()
Returns parameters and parameter groups on the module. Those parameters included in the parameter groups are not included in the return list.- Returns:
- parameters and parameter groups
-
getAllDataSources
public final java.util.List getAllDataSources()
Returns all data source handles that this modules and the included modules contain.- Returns:
- all data source handles that this modules and the included modules contain.
-
getVisibleDataSources
public final java.util.List getVisibleDataSources()
Returns data source handles that are visible to this modules.- Returns:
- data source handles that are visible to this modules.
-
getAllDataSets
public final java.util.List getAllDataSets()
Returns all data set handles that this modules and the included modules contain.- Returns:
- all data set handles that this modules and the included modules contain.
-
getVisibleDataSets
public final java.util.List getVisibleDataSets()
Returns data set handles that are visible to this modules.- Returns:
- data set handles that are visible to this modules.
-
getAllCubes
public final java.util.List getAllCubes()
Returns all cube handles that this modules and the included modules contain.- Returns:
- all cube handles that this modules and the included modules contain.
-
getVisibleCubes
public final java.util.List getVisibleCubes()
Returns cube handles that are visible to this modules.- Returns:
- cube handles that are visible to this modules.
-
getVisibleImages
public final java.util.List getVisibleImages()
Returns the embedded images which are defined on the module itself. The embedded images defined in the included libraries will not be returned by this method.- Returns:
- the local embedded image list.
-
getAllPages
public java.util.List getAllPages()
Returns all page handles that this modules and the included modules contain.- Returns:
- all page handles that this modules and the included modules contain.
-
getAllParameters
public final java.util.List getAllParameters()
Returns all parameter handles that this modules.- Returns:
- all parameter handles that this modules.
-
getAllLibraries
public final java.util.List getAllLibraries()
Returns the libraries this report design includes directly or indirectly. Each in the returned list is the instance ofLibraryHandle.- Returns:
- the libraries this report design includes directly or indirectly.
-
getLibraries
protected final java.util.List getLibraries(int level)
Returns included libaries this report design includes directly or indirectly within the given depth.- Parameters:
level- the given depth- Returns:
- list of libraries.
-
getLibraries
public final java.util.List getLibraries()
Returns the libraries this report design includes directly. Each in the returned list is the instance ofLibraryHandle.- Returns:
- the libraries this report design includes directly.
-
getLibrary
public final LibraryHandle getLibrary(java.lang.String namespace)
Returns the library handle with the given namespace.- Parameters:
namespace- the library namespace- Returns:
- the library handle with the given namespace
-
findLibrary
public final LibraryHandle findLibrary(java.lang.String fileName)
Returns the library handle with the given file name. The filename can include directory information, either relative or absolute directory. And the file should be on the local disk.- Parameters:
fileName- the library file name. The filename can include directory information, either relative or absolute directory. And the file should be on the local disk.- Returns:
- the library handle with the given file name
-
shiftLibrary
public void shiftLibrary(LibraryHandle library, int toPosn) throws SemanticException
Shifts the library to new position. This method might affect the style reference, because the library order is changed.- Parameters:
library- the library to shifttoPosn- the new position- Throws:
SemanticException- if error is encountered when shifting
-
isReadOnly
public final boolean isReadOnly()
Returns whether this module is read-only.- Returns:
- true, if this module is read-only. Otherwise, return false.
-
includeLibrariesIterator
public java.util.Iterator includeLibrariesIterator()
Returns the iterator over all included libraries. Each one is the instance ofIncludeLibraryHandle- Returns:
- the iterator over all included libraries.
- See Also:
IncludedLibraryHandle
-
includeLibrary
public void includeLibrary(java.lang.String libraryFileName, java.lang.String namespace) throws DesignFileException, SemanticExceptionIncludes one library with the given library file name. The new library will be appended to the library list.- Parameters:
libraryFileName- library file namenamespace- library namespace- Throws:
DesignFileException- if the library file is not found, or has fatal error.SemanticException- if error is encountered when handlingIncludeLibrarystructure list.
-
dropLibrary
public void dropLibrary(LibraryHandle library) throws SemanticException
Drops the given library from the included libraries of this design file.- Parameters:
library- the library to drop- Throws:
SemanticException- if error is encountered when handlingIncludeLibrarystructure list. Or it maybe because that the given library is not found in the design. Or that the library has descedents in the current module
-
reloadLibrary
public void reloadLibrary(LibraryHandle libraryToReload) throws SemanticException, DesignFileException
Reloads the library with the given library file path. If the library already is included directly, reload it. If the library is not included, exception will be thrown.Call this method cautiously ONLY on the condition that the library file is REALLY changed outside. After reload successfully, the command stack is cleared.
- Parameters:
libraryToReload- the library instance- Throws:
SemanticException- if error is encountered when handlingIncludeLibrarystructure list. Or it maybe because that the given library is not found in the design. Or that the library has descedents in the current moduleDesignFileException- if the library file is not found, or has fatal error.
-
reloadLibraries
public void reloadLibraries() throws SemanticException, DesignFileExceptionReloads all libraries this module included.Call this method cautiously ONLY on the condition that the library file is REALLY changed outside. After reload successfully, the command stack is cleared.
reloadLibrary(LibraryHandle)- Throws:
SemanticExceptionDesignFileException
-
reloadLibrary
public void reloadLibrary(java.lang.String reloadPath) throws SemanticException, DesignFileExceptionReloads the library with the given library file path. If the library already is included directly or indirectly(that is, the reload path could be the path of grandson of this module), reload it. If the library is not included, exception will be thrown.Call this method cautiously ONLY on the condition that the library file is REALLY changed outside. After reload successfully, the command stack is cleared.
- Parameters:
reloadPath- this is supposed to be an absolute path, not in url form.- Throws:
SemanticException- if error is encountered when handlingIncludeLibrarystructure list. Or it maybe because that the given library is not found in the design. Or that the library has descedents in the current moduleDesignFileException- if the library file is not found, or has fatal error.
-
dropLibraryAndBreakExtends
public void dropLibraryAndBreakExtends(LibraryHandle library) throws SemanticException
Drops the given library from the design and break all the parent/child relationships. All child element will be localized in the module.- Parameters:
library- the given library to drop- Throws:
SemanticException- if errors occured when drop the library.It may be because that the library is not found in the design or that some elements can not be localized properly.
-
addAttributeListener
public final void addAttributeListener(IAttributeListener listener)
Adds one attribute listener. The duplicate listener will not be added.- Parameters:
listener- the attribute listener to add
-
removeAttributeListener
public final boolean removeAttributeListener(IAttributeListener listener)
Removes one attribute listener. If the listener not registered, then the request is silently ignored.- Parameters:
listener- the attribute listener to remove- Returns:
trueiflisteneris successfully removed. Otherwisefalse.
-
addDisposeListener
public final void addDisposeListener(IDisposeListener listener)
Adds one dispose listener. The duplicate listener will not be added.- Parameters:
listener- the dispose listener to add
-
addResourceChangeListener
public final void addResourceChangeListener(IResourceChangeListener listener)
Adds one resource change listener. The duplicate listener will not be added.- Parameters:
listener- the resource change listener to add
-
removeDisposeListener
public final boolean removeDisposeListener(IDisposeListener listener)
Removes one dispose listener. If the listener not registered, then the request is silently ignored.- Parameters:
listener- the dispose listener to remove- Returns:
trueiflisteneris successfully removed. Otherwisefalse.
-
removeResourceChangeListener
public final boolean removeResourceChangeListener(IResourceChangeListener listener)
Removes one resource change listener. If the listener not registered, then the request is silently ignored.- Parameters:
listener- the resource change listener to remove- Returns:
trueiflisteneris successfully removed. Otherwisefalse.
-
drop
public final void drop() throws SemanticExceptionDescription copied from class:DesignElementHandleDrops this element from the design. Removes the element from its container and name space, if any.Note: If this element is referencable, the property referring it will be unresolved.
- Overrides:
dropin classDesignElementHandle- Throws:
SemanticException- if this element has no container or the element cannot be dropped.- See Also:
SlotHandle,DesignElementHandle.dropAndClear()
-
dropAndClear
public final void dropAndClear() throws SemanticExceptionDescription copied from class:DesignElementHandleDrops this element from the design. Removes the element from its container and name space, if any.Note: If this element is referencable, the property referring it will be set null.
- Overrides:
dropAndClearin classDesignElementHandle- Throws:
SemanticException- if this element has no container or the element cannot be dropped.- See Also:
SlotHandle,DesignElementHandle.drop()
-
getIncludeResource
public final java.lang.String getIncludeResource()
Get the base name of the customer-defined resource bundle.- Returns:
- the base name of the customer-defined resource bundle.
-
getIncludeResources
public final java.util.List<java.lang.String> getIncludeResources()
- Returns:
-
setIncludeResource
public final void setIncludeResource(java.lang.String baseName)
Set the base name of the customer-defined resource bundle. The name is a common base name, e.g: "myMessage" without the Language_Country suffix, then the message file family can be "myMessage_en.properties", "myMessage_zh_CN.properties" etc. The message file is stored in the same folder as the design file.- Parameters:
baseName- common base name of the customer-defined resource bundle.
-
setIncludeResources
public final void setIncludeResources(java.util.List<java.lang.String> baseNameList)
Set the list of base name of the customer-defined resource bundles. The name is a common base name, e.g: "myMessage" without the Language_Country suffix, then the message file family can be "myMessage_en.properties", "myMessage_zh_CN.properties" etc. The message file is stored in the same folder as the design file.- Parameters:
baseNameList- list of the base name
-
findResource
public final java.net.URL findResource(java.lang.String fileName, int fileType)Returns theURLobject if the file withfileNameexists. This method takes the following search steps:-
If file type is MESSAGEFILE ,
- Search file with the file locator (
IResourceLocator) in session. And Now just deal with relative file name.-
If file type is not MESSAGEFILE,
- Search file taking
fileNameas absolute file name; - Search file taking
fileNameas relative file name and basing "base" property of report design; - Search file with the file locator (
IResourceLocator) in session
- Search file taking
- Parameters:
fileName- file name to searchfileType- file type. The value should be one of:IResourceLocator.IMAGEIResourceLocator.LIBRARYIResourceLocator.MESSAGEFILE
IResourceLocator.IMAGE.- Returns:
- the
URLobject if the file withfileNameis found, or null otherwise.
- Search file with the file locator (
-
findResource
public final java.net.URL findResource(java.lang.String fileName, int fileType, java.util.Map appContext)Returns theURLobject if the file withfileNameexists. This method takes the following search steps:-
If file type is MESSAGEFILE ,
- Search file with the file locator (
IResourceLocator) in session. And Now just deal with relative file name.-
If file type is not MESSAGEFILE,
- Search file taking
fileNameas absolute file name; - Search file taking
fileNameas relative file name and basing "base" property of report design; - Search file with the file locator (
IResourceLocator) in session
- Search file taking
- Parameters:
fileName- file name to searchfileType- file type. The value should be one of:IResourceLocator.IMAGEIResourceLocator.LIBRARYIResourceLocator.MESSAGEFILE
IResourceLocator.IMAGE.appContext- The map containing the user's information- Returns:
- the
URLobject if the file withfileNameis found, or null otherwise.
- Search file with the file locator (
-
openCssStyleSheet
public CssStyleSheetHandle openCssStyleSheet(java.lang.String fileName) throws StyleSheetException
Gets the result style sheet with given file name of an external CSS2 resource.- Parameters:
fileName- the file name of the external CSS resource- Returns:
- the
CssStyleSheetHandleif the external resource is successfully loaded - Throws:
StyleSheetException- thrown if the resource is not found, or there are syntax errors in the resource
-
openCssStyleSheet
public CssStyleSheetHandle openCssStyleSheet(java.io.InputStream is) throws StyleSheetException
Gets the result style sheet with given file name of an external CSS2 resource.- Parameters:
is- the input stream of the resource- Returns:
- the
CssStyleSheetHandleif the external resource is successfully loaded - Throws:
StyleSheetException- thrown if the resource is not found, or there are syntax errors in the resource
-
importCssStyles
public void importCssStyles(CssStyleSheetHandle stylesheet, java.util.List selectedStyles)
Imports the selected styles in aCssStyleSheetHandleto the module. Each in the list is instance ofSharedStyleHandle.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.- Parameters:
stylesheet- the style sheet handle that contains all the selected stylesselectedStyles- the selected style list
-
setThemeName
public void setThemeName(java.lang.String themeName) throws SemanticExceptionSets the theme to a report.- Parameters:
themeName- the name of the theme- Throws:
SemanticException
-
getTheme
public final ThemeHandle getTheme()
Returns the refresh rate when viewing the report.- Returns:
- the refresh rate
-
setTheme
public void setTheme(ThemeHandle theme) throws SemanticException
Sets the theme to a report.- Parameters:
theme- the theme instance- Throws:
SemanticException
-
isInclude
public final boolean isInclude(LibraryHandle library)
Checks whether there is an included library in this module, which has the same absolute path as that of the given library.- Parameters:
library- the library to check- Returns:
- true if there is an included library in this module, which has the same absolute path as that the given library, otherwise false
-
getDescription
public final java.lang.String getDescription()
Returns the static description for the module.- Returns:
- the static description to display
-
getDisplayDescription
public final java.lang.String getDisplayDescription()
Returns the localized description for the module. If the localized description for the description resource key is found, it will be returned. Otherwise, the static description will be returned.- Returns:
- the localized description for the module
-
setDescription
public final void setDescription(java.lang.String description) throws SemanticExceptionSets the description of the module. Sets the static description itself. If the module is to be externalized, then set the description ID separately.- Parameters:
description- the new description for the module- Throws:
SemanticException- if the property is locked.
-
getDescriptionKey
public final java.lang.String getDescriptionKey()
Returns the resource key of the static description of the module.- Returns:
- the resource key of the static description
-
setDescriptionKey
public final void setDescriptionKey(java.lang.String resourceKey) throws SemanticExceptionSets the resource key of the static description of the module.- Parameters:
resourceKey- the resource key of the static description- Throws:
SemanticException- if the resource key property is locked.
-
getTitle
public final java.lang.String getTitle()
Gets the title property value.- Returns:
- the title property value.
-
setTitle
public final void setTitle(java.lang.String title) throws SemanticExceptionSets the title value.- Parameters:
title- the title.- Throws:
SemanticException
-
getTitleKey
public final java.lang.String getTitleKey()
Gets the title key.- Returns:
- the title key.
-
setTitleKey
public final void setTitleKey(java.lang.String titleKey) throws SemanticExceptionSets the title key.- Parameters:
titleKey- the title key.- Throws:
SemanticException
-
initializeModule
public final void initializeModule(java.util.Map properties) throws SemanticExceptionInitializes the report design when it is just created.Set the value to the properties on repot design element which need the initialize valuel. All initialize operations will not go into the command stack and can not be undo redo.
- Parameters:
properties- the property name value pairs.Those properties in the map are which need to be initialized.- Throws:
SemanticException- SemamticException will throw out when the give properties map contians invlid property name or property value.
-
getFileEncoding
public final java.lang.String getFileEncoding()
Returns the encoding of the design/library file. Currently, BIRT only support UnicodeUtil.SIGNATURE_UTF_8.- Returns:
- the encoding of the file
-
getSymbolicName
public final java.lang.String getSymbolicName()
Gets symbolic name of this module if defined. This property is needed when search resources in fragments. Usually it should be the plug-in id of the host plug-in.- Returns:
- the symbolica name of this module
-
setSymbolicName
public final void setSymbolicName(java.lang.String symbolicName) throws SemanticExceptionSets symbolic name of this module. This property is needed when search resources in fragments. Usually it should be the plug-in id of the host plug-in.- Parameters:
symbolicName-- Throws:
SemanticException
-
getSystemId
public final java.net.URL getSystemId()
Returns the system id of the module. It is the URL path of the module.- Returns:
- the system id of the module
-
dropScriptLib
public final void dropScriptLib(ScriptLib scriptLib) throws SemanticException
Removes special script lib.- Parameters:
scriptLib- script lib- Throws:
SemanticException
-
dropIncludeScript
public final void dropIncludeScript(IncludeScript includeScript) throws SemanticException
Removes the given included script.- Parameters:
includeScript- the included script- Throws:
SemanticException
-
dropScriptLib
public final void dropScriptLib(ScriptLibHandle scriptLibHandle) throws SemanticException
Removes special script lib handle.- Parameters:
scriptLibHandle- script lib handle- Throws:
SemanticException
-
dropAllScriptLibs
public final void dropAllScriptLibs() throws SemanticExceptionRemoves all script libs.- Throws:
SemanticException
-
scriptLibsIterator
public final java.util.Iterator scriptLibsIterator()
Returns the iterator over all script libs. Each one is the instance ofScriptLibHandle.- Returns:
- the iterator over script libs.
- See Also:
ScriptLibHandle
-
getAllScriptLibs
public final java.util.List getAllScriptLibs()
Returns all script libs.- Returns:
- list which structure is
ScriptLibHandle
-
findScriptLib
public final ScriptLib findScriptLib(java.lang.String name)
Gets script lib though name- Parameters:
name- name of script lib- Returns:
- script lib
-
shiftScriptLibs
public final void shiftScriptLibs(int sourceIndex, int destIndex) throws SemanticExceptionShifts jar file from source position to destination position. For example, if a list has A, B, C scriptLib in order, when move A scriptLib tonewPosnwith the value 1, the sequence becomes B, A, C.- Parameters:
sourceIndex- source position. The range issourceIndex >= 0 && sourceIndex < list.size()destIndex- destination position.The range isdestIndex >= 0 && destIndex < list.size()- Throws:
SemanticException
-
shifIncludeScripts
public final void shifIncludeScripts(int sourceIndex, int destIndex) throws SemanticExceptionShifts included script from source position to destination position. For example, if a list has A, B, C scriptLib in order, when move Am includeScript tonewPosnwith the value 1, the sequence becomes B, A, C.- Parameters:
sourceIndex- source position. The range issourceIndex >= 0 && sourceIndex < list.size()destIndex- destination position.The range isdestIndex >= 0 && destIndex < list.size()- Throws:
SemanticException
-
addScriptLib
public final void addScriptLib(ScriptLib scriptLib) throws SemanticException
Add script lib- Parameters:
scriptLib- script lib- Throws:
SemanticException
-
addIncludeScript
public final void addIncludeScript(IncludeScript includeScript) throws SemanticException
Adds include script.- Parameters:
includeScript- the include script- Throws:
SemanticException
-
setResourceFolder
public final void setResourceFolder(java.lang.String resourceFolder)
Sets the resource folder for this module.- Parameters:
resourceFolder- the folder to set
-
getResourceFolder
public final java.lang.String getResourceFolder()
Gets the resource folder set in this module.- Returns:
- the resource folder set in this module
-
getLineNoByID
@Deprecated public final int getLineNoByID(long id)
Deprecated.new method seegetLineNo(Object)Looks up line number of the element in xml source given an element ID. Returns 1 if no line number of the element exists with the given ID.- Parameters:
id- The id of the element to find.- Returns:
- The line number of the element given the element id, or 1 if the element can't be found or if IDs are not enabled.
-
getLineNo
public final int getLineNo(java.lang.Object obj)
looks up line number of the element\property\structure, in xml source with given xPaht. Returns 1 if there is no corresponding element\property\structure.- Parameters:
obj- The xPath of the element\property\structure, it should be unique in an report file.- Returns:
- The line number of the element\property\structure, or 1 if corresponding item does not exist.
-
getVersion
public final java.lang.String getVersion()
Returns the version for the opened design file. If the report/library is newly created, the version isnull. Only the opened/saved report/library have the version information.Whenever the report/library is save, the version becomes
DesignSchemaConstants.REPORT_VERSION. That is, the saved report/library always have the latest version.- Returns:
- the design file version number
-
includeScriptsIterator
public final java.util.Iterator includeScriptsIterator()
Returns the iterator over all included scripts. Each one is the instance ofIncludeScriptHandle- Returns:
- the iterator over all included scripts.
- See Also:
IncludeScriptHandle
-
getAllIncludeScripts
public final java.util.List getAllIncludeScripts()
Gets all included scripts. Includes those defined in the libraries.- Returns:
- the list of included script. Each item is an instance of
IncludeScriptHandle.
-
copy
public final IDesignElement copy()
Description copied from class:DesignElementHandleDeeply clones the current design element which is wrapped by the handle.- Overrides:
copyin classDesignElementHandle- Returns:
- the copy of the design element
-
sortVisibleElements
protected final java.util.List sortVisibleElements(java.util.List nameSpaceList, int level)Sorts visible elements. Check value in design handle and libraries and sort the sequence as list in slot handle.- Parameters:
nameSpaceList- the list contains elements from name spacelevel- level- Returns:
- the list contains sorted design elements.
-
getVisibleModules
protected java.util.List<ModuleHandleImpl> getVisibleModules(int level)
Gets the visible modules.- Parameters:
level-- Returns:
-
generateHandleList
protected java.util.List generateHandleList(java.util.List elementList)
Generates a list of element handles according to the given element list. Each content in the return list is generated useelement.getHandle( Module )- Parameters:
elementList- a list of elements.- Returns:
- a list of element handles.
-
getAllSharedDimensions
public java.util.List<DimensionHandle> getAllSharedDimensions()
Gets all the shared dimensions defined or accessed by this module.- Returns:
-
checkReportIfNecessary
public void checkReportIfNecessary()
Checks the report if it is set in options.
-
setOptions
public void setOptions(java.util.Map options)
Sets options to the module.- Parameters:
options-
-
getOptions
public java.util.Map getOptions()
Gets the options set in the module.- Returns:
-
-