public class LibraryHandle extends LibraryHandleImpl implements org.eclipse.birt.report.model.elements.interfaces.ILibraryModel
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. |
There are two cases that this library handle represents:
isInitialized
module
CUBE_SLOT, SLOT_COUNT, THEMES_SLOT
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
COMMENTS_PROP, CUSTOM_XML_PROP, DISPLAY_NAME_ID_PROP, DISPLAY_NAME_PROP, EVENT_HANDLER_CLASS_PROP, EXTENDS_PROP, FULL_LABEL, ID_SUFFIX, NAME_PROP, NEW_HANDLER_ON_EACH_EVENT_PROP, NO_SLOT, PROPERTY_MASKS_PROP, REF_TEMPLATE_PARAMETER_PROP, SHORT_LABEL, USER_LABEL, USER_PROPERTIES_PROP, VIEW_ACTION_PROP
Constructor and Description |
---|
LibraryHandle(org.eclipse.birt.report.model.elements.Library library)
Constructs one library handle with the given library element.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigVariable(ConfigVariable configVar)
Adds a new config variable.
|
void |
addImage(EmbeddedImage image)
Adds a new embedded image.
|
void |
addTranslation(java.lang.String resourceKey,
java.lang.String locale,
java.lang.String text)
Adds a new translation to the design.
|
void |
dropConfigVariable(java.lang.String name)
Drops a config variable.
|
void |
dropImage(java.util.List images)
Drops an embedded image handle list from the design.
|
void |
dropImage(java.lang.String name)
Drops an embedded image from the design.
|
void |
dropLibrary(LibraryHandle library)
Drops the given library from the included libraries of this design file.
|
void |
dropLibraryAndBreakExtends(LibraryHandle library)
Drops the given library from the design and break all the parent/child
relationships.
|
void |
dropTranslation(java.lang.String resourceKey,
java.lang.String locale)
Drops a translation from the design.
|
java.util.List |
getAllPages()
Returns all page handles that this modules and the included modules
contain.
|
java.util.List |
getAllStyles()
Returns all style element handles that this modules and the included
modules contain.
|
SlotHandle |
getComponents()
Returns a slot handle to work with the top-level components within the
report.
|
SlotHandle |
getDataSets()
Returns a slot handle to work with the data sets within the report.
|
SlotHandle |
getDataSources()
Returns a slot handle to work with the data sources within the report.
|
java.util.List |
getFlattenParameters()
Returns the flatten Parameters/ParameterGroups of the design.
|
SlotHandle |
getMasterPages()
Returns a slot handle to work with the master pages within the report.
|
SlotHandle |
getParameters()
Returns a slot handle to work with the top-level parameters and parameter
groups within the report.
|
java.util.List |
getParametersAndParameterGroups()
Returns parameters and parameter groups on the module.
|
java.util.List<ReportItemThemeHandle> |
getVisibleReportItemThemes(int level,
java.lang.String type)
Returns report item theme handles according the input level.
|
java.util.List |
getVisibleThemes(int level)
Returns theme handles according the input level.
|
java.util.Iterator |
imagesIterator()
Returns the iterator over all embedded images of this module instance.
|
java.util.Iterator |
includeLibrariesIterator()
Returns the iterator over all included libraries.
|
void |
includeLibrary(java.lang.String libraryFileName,
java.lang.String namespace)
Includes one library with the given library file name.
|
CssStyleSheetHandle |
openCssStyleSheet(java.io.InputStream is)
Gets the result style sheet with given file name of an external CSS2
resource.
|
CssStyleSheetHandle |
openCssStyleSheet(java.lang.String fileName)
Gets the result style sheet with given file name of an external CSS2
resource.
|
void |
reloadLibraries()
Reloads all libraries this module included.
|
void |
reloadLibrary(LibraryHandle libraryToReload)
Reloads the library with the given library file path.
|
void |
reloadLibrary(java.lang.String reloadPath)
Reloads the library with the given library file path.
|
void |
replaceConfigVariable(ConfigVariable oldVar,
ConfigVariable newVar)
Replaces the old config variable with the new one.
|
void |
replaceImage(EmbeddedImage oldVar,
EmbeddedImage newVar)
Replaces the old embedded image with the new one.
|
void |
setTheme(ThemeHandle theme)
Sets the theme to a report.
|
void |
setThemeName(java.lang.String themeName)
Sets the theme to a report.
|
void |
shiftLibrary(LibraryHandle library,
int toPosn)
Shifts the library to new position.
|
getCubes, getHostHandle, getNamespace, getRelativeFileName, getStyles, getThemes, importCssStyles, importCssStyles, isDirectionRTL
addAttributeListener, addDisposeListener, addIncludeScript, addResourceChangeListener, addScriptLib, addValidationListener, checkReport, checkReportIfNecessary, close, configVariablesIterator, copy, customColorsIterator, drop, dropAllScriptLibs, dropAndClear, dropIncludeScript, dropScriptLib, dropScriptLib, findCascadingParameterGroup, findColor, findConfigVariable, findCube, findDataSet, findDataSource, findDimension, findElement, findImage, findJointDataSet, findLevel, findLibrary, findMasterPage, findNativeStyle, findParameter, findReportItemTheme, findResource, findResource, findScriptLib, findStyle, findTemplateDataSet, findTheme, generateHandleList, getAllCubes, getAllDataSets, getAllDataSources, getAllImages, getAllIncludeScripts, getAllLibraries, getAllParameters, getAllScriptLibs, getAllSharedDimensions, getAuthor, getCommandStack, getComments, getCreatedBy, getDefaultUnits, getDescription, getDescriptionKey, getDisplayDescription, getElement, getElementByID, getErrorList, getFileEncoding, getFileName, getHelpGuide, getIncludeResource, getIncludeResources, getInitialize, getLibraries, getLibraries, getLibrary, getLineNo, getLineNoByID, getMessage, getMessage, getMessage, getMessageKeys, getNativeStructureList, getOptions, getResourceFolder, getSubject, getSymbolicName, getSystemId, getTheme, getTitle, getTitleKey, getTranslation, getTranslationKeys, getTranslations, getVersion, getVisibleCubes, getVisibleDataSets, getVisibleDataSources, getVisibleImages, getVisibleModules, getWarningList, includeScriptsIterator, initializeModule, isInclude, isReadOnly, needsSave, onSave, removeAttributeListener, removeDisposeListener, removeResourceChangeListener, removeValidationListener, rename, rename, rename, save, saveAs, scriptLibsIterator, serialize, setAuthor, setComments, setCreatedBy, setDefaultUnits, setDescription, setDescriptionKey, setFileName, setHelpGuide, setIncludeResource, setIncludeResources, setInitialize, setOptions, setResourceFolder, setSubject, setSymbolicName, setTitle, setTitleKey, shifIncludeScripts, shiftScriptLibs, sortVisibleElements
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, 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, isInTemplateParameter, isTemplateParameterValue, isValid, localize, move, move, moveTo, moveTo, moveTo, moveTo, newHandlerOnEachEvent, paste, paste, paste, paste, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setBooleanProperty, setEncryption, setEventHandlerClass, setExpressionProperty, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setName, setNewHandlerOnEachEvent, setNumberProperty, setProperties, setProperty, setPropertyBinding, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError, slotsIterator
public LibraryHandle(org.eclipse.birt.report.model.elements.Library library)
library
- library elementpublic void addConfigVariable(ConfigVariable configVar) throws SemanticException
ModuleHandleImpl
addConfigVariable
in class ModuleHandleImpl
configVar
- the config variableSemanticException
- if the name is empty or the same name exists.public void addImage(EmbeddedImage image) throws SemanticException
ModuleHandleImpl
addImage
in class ModuleHandleImpl
image
- the image to addSemanticException
- if the name is empty, type is invalid, or the same name
exists.public void addTranslation(java.lang.String resourceKey, java.lang.String locale, java.lang.String text) throws CustomMsgException
ModuleHandleImpl
addTranslation
in class ModuleHandleImpl
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 localeCustomMsgException
- if the resource key is duplicate or missing, or locale is not
a valid format.ModuleHandleImpl.getTranslation(String, String)
public void dropConfigVariable(java.lang.String name) throws SemanticException
ModuleHandleImpl
dropConfigVariable
in class ModuleHandleImpl
name
- config variable nameSemanticException
- if no config variable is found.public void dropImage(java.util.List images) throws SemanticException
ModuleHandleImpl
EmbeddedImageHandle
.dropImage
in class ModuleHandleImpl
images
- the image handle list to removeSemanticException
- if any image in the list is not found.public void dropImage(java.lang.String name) throws SemanticException
ModuleHandleImpl
dropImage
in class ModuleHandleImpl
name
- the image nameSemanticException
- if the image is not found.public void dropTranslation(java.lang.String resourceKey, java.lang.String locale) throws CustomMsgException
ModuleHandleImpl
dropTranslation
in class ModuleHandleImpl
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.)CustomMsgException
- if resourceKey
is null
.ModuleHandleImpl.getTranslation(String, String)
public SlotHandle getComponents()
ModuleHandleImpl
getComponents
in class ModuleHandleImpl
public SlotHandle getDataSets()
ModuleHandleImpl
getDataSets
in class ModuleHandleImpl
public SlotHandle getDataSources()
ModuleHandleImpl
getDataSources
in class ModuleHandleImpl
public java.util.List getFlattenParameters()
ModuleHandleImpl
getFlattenParameters
in class ModuleHandleImpl
public SlotHandle getMasterPages()
ModuleHandleImpl
getMasterPages
in class ModuleHandleImpl
public SlotHandle getParameters()
ModuleHandleImpl
getParameters
in class ModuleHandleImpl
public java.util.Iterator imagesIterator()
ModuleHandleImpl
EmbeddedImageHandle
imagesIterator
in class ModuleHandleImpl
EmbeddedImageHandle
public void replaceConfigVariable(ConfigVariable oldVar, ConfigVariable newVar) throws SemanticException
ModuleHandleImpl
replaceConfigVariable
in class ModuleHandleImpl
oldVar
- the old config variablenewVar
- the new config variableSemanticException
- if the old config variable is not found or the name of new
one is empty.public void replaceImage(EmbeddedImage oldVar, EmbeddedImage newVar) throws SemanticException
ModuleHandleImpl
replaceImage
in class ModuleHandleImpl
oldVar
- the old embedded imagenewVar
- the new embedded imageSemanticException
- if the old image is not found or the name of new one is
empty.public java.util.List getAllStyles()
ModuleHandleImpl
getAllStyles
in class ModuleHandleImpl
public java.util.List getVisibleThemes(int level)
ModuleHandleImpl
getVisibleThemes
in class ModuleHandleImpl
level
- an int
value, which should be the one defined in
IVisibleLevelControl
.public java.util.List<ReportItemThemeHandle> getVisibleReportItemThemes(int level, java.lang.String type)
ModuleHandleImpl
getVisibleReportItemThemes
in class ModuleHandleImpl
level
- an int
value, which should be the one defined in
IVisibleLevelControl
.public java.util.List getParametersAndParameterGroups()
ModuleHandleImpl
getParametersAndParameterGroups
in class ModuleHandleImpl
public java.util.List getAllPages()
ModuleHandleImpl
getAllPages
in class ModuleHandleImpl
public void shiftLibrary(LibraryHandle library, int toPosn) throws SemanticException
ModuleHandleImpl
shiftLibrary
in class ModuleHandleImpl
library
- the library to shifttoPosn
- the new positionSemanticException
- if error is encountered when shiftingpublic java.util.Iterator includeLibrariesIterator()
ModuleHandleImpl
IncludeLibraryHandle
includeLibrariesIterator
in class ModuleHandleImpl
IncludedLibraryHandle
public void includeLibrary(java.lang.String libraryFileName, java.lang.String namespace) throws DesignFileException, SemanticException
ModuleHandleImpl
includeLibrary
in class ModuleHandleImpl
libraryFileName
- library file namenamespace
- library namespaceDesignFileException
- if the library file is not found, or has fatal error.SemanticException
- if error is encountered when handling IncludeLibrary
structure list.public void dropLibrary(LibraryHandle library) throws SemanticException
ModuleHandleImpl
dropLibrary
in class ModuleHandleImpl
library
- the library to dropSemanticException
- if error is encountered when handling IncludeLibrary
structure list. Or it maybe because that the given
library is not found in the design. Or that the library has
descedents in the current modulepublic void reloadLibrary(LibraryHandle libraryToReload) throws SemanticException, DesignFileException
ModuleHandleImpl
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
in class ModuleHandleImpl
libraryToReload
- the library instanceSemanticException
- if error is encountered when handling IncludeLibrary
structure 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.public void reloadLibraries() throws SemanticException, DesignFileException
ModuleHandleImpl
Call this method cautiously ONLY on the condition that the library file
is REALLY changed outside. After reload successfully, the command stack
is cleared.
ModuleHandleImpl.reloadLibrary(LibraryHandle)
reloadLibraries
in class ModuleHandleImpl
SemanticException
DesignFileException
public void reloadLibrary(java.lang.String reloadPath) throws SemanticException, DesignFileException
ModuleHandleImpl
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
in class ModuleHandleImpl
reloadPath
- this is supposed to be an absolute path, not in url form.SemanticException
- if error is encountered when handling IncludeLibrary
structure 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.public void dropLibraryAndBreakExtends(LibraryHandle library) throws SemanticException
ModuleHandleImpl
dropLibraryAndBreakExtends
in class ModuleHandleImpl
library
- the given library to dropSemanticException
- 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.public CssStyleSheetHandle openCssStyleSheet(java.lang.String fileName) throws StyleSheetException
ModuleHandleImpl
openCssStyleSheet
in class ModuleHandleImpl
fileName
- the file name of the external CSS resourceCssStyleSheetHandle
if the external resource is
successfully loadedStyleSheetException
- thrown if the resource is not found, or there are syntax
errors in the resourcepublic CssStyleSheetHandle openCssStyleSheet(java.io.InputStream is) throws StyleSheetException
ModuleHandleImpl
openCssStyleSheet
in class ModuleHandleImpl
is
- the input stream of the resourceCssStyleSheetHandle
if the external resource is
successfully loadedStyleSheetException
- thrown if the resource is not found, or there are syntax
errors in the resourcepublic void setThemeName(java.lang.String themeName) throws SemanticException
ModuleHandleImpl
setThemeName
in class ModuleHandleImpl
themeName
- the name of the themeSemanticException
public void setTheme(ThemeHandle theme) throws SemanticException
ModuleHandleImpl
setTheme
in class ModuleHandleImpl
theme
- the theme instanceSemanticException
Copyright © 2014 OpenText Corp. All rights reserved.