Class LibraryHandleImpl
java.lang.Object
org.eclipse.birt.report.model.api.DesignElementHandle
org.eclipse.birt.report.model.api.ModuleHandleImpl
org.eclipse.birt.report.model.api.ModuleHandle
org.eclipse.birt.report.model.api.LibraryHandleImpl
- All Implemented Interfaces:
IModuleModel,org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel,org.eclipse.birt.report.model.elements.interfaces.IInternalLibraryModel,org.eclipse.birt.report.model.elements.interfaces.ILibraryModel
- Direct Known Subclasses:
LibraryHandle
public abstract class LibraryHandleImpl
extends ModuleHandle
implements org.eclipse.birt.report.model.elements.interfaces.ILibraryModel
-
Field Summary
Fields inherited from class org.eclipse.birt.report.model.api.ModuleHandleImpl
isInitializedFields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
moduleFields 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_PROPFields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IInternalLibraryModel
CUBE_SLOT, SLOT_COUNT, THEMES_SLOTFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigVariable(ConfigVariable configVar) Adds a new config variable.voidaddImage(EmbeddedImage image) Adds a new embedded image.voidaddTranslation(String resourceKey, String locale, String text) Adds a new translation to the design.voiddropConfigVariable(String name) Drops a config variable.voidDrops an embedded image from the design.voidDrops an embedded image handle list from the design.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.voiddropTranslation(String resourceKey, String locale) Drops a translation from the design.Returns all page handles that this modules and the included modules contain.Returns all style element handles that this modules and the included modules contain.Returns a slot handle to work with the top-level components within the report.getCubes()Gets the slot handle to work with all cube elements within the report.Returns a slot handle to work with the data sets within the report.Returns a slot handle to work with the data sources within the report.Returns the flatten Parameters/ParameterGroups of the design.Returns the host handle which includes the library.Returns a slot handle to work with the master pages within the report.Returns the library namespace, which identifies one library unqiuely in one design file.Returns a slot handle to work with the top-level parameters and parameter groups within the report.Returns parameters and parameter groups on the module.If this library is included by a module, return the relative file name that is defined in the host's xml file.Deprecated.uses the theme insteadReturns a slot handle to work with the themes within the library.getVisibleReportItemThemes(int level, String type) Returns report item theme handles according the input level.getVisibleThemes(int level) Returns theme handles according the input level.Returns the iterator over all embedded images of this module instance.voidimportCssStyles(CssStyleSheetHandle stylesheet, List selectedStyles) Import css file to theme.voidimportCssStyles(CssStyleSheetHandle stylesheet, List selectedStyles, String themeName) Imports the selected styles in aCssStyleSheetHandleto the given theme of the library.Returns the iterator over all included libraries.voidincludeLibrary(String libraryFileName, String namespace) Includes one library with the given library file name.booleanExamines whether the resolved direction of this design element is Right to Left or not.Gets the result style sheet with given file name of an external CSS2 resource.openCssStyleSheet(String fileName) Gets the result style sheet with given file name of an external CSS2 resource.voidReloads all libraries this module included.voidreloadLibrary(String reloadPath) Reloads the library with the given library file path.voidreloadLibrary(LibraryHandle libraryToReload) Reloads the library with the given library file path.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.voidsetTheme(ThemeHandle theme) Sets the theme to a report.voidsetThemeName(String themeName) Sets the theme to a report.voidshiftLibrary(LibraryHandle library, int toPosn) Shifts the library to new position.Methods inherited from class org.eclipse.birt.report.model.api.ModuleHandleImpl
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, sortVisibleElementsMethods 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, getTagType, 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
-
Constructor Details
-
LibraryHandleImpl
public LibraryHandleImpl(org.eclipse.birt.report.model.core.Module module)
-
-
Method Details
-
getHostHandle
Returns the host handle which includes the library.- Returns:
- the host handle which include this library.
-
getNamespace
Returns the library namespace, which identifies one library unqiuely in one design file.- Returns:
- the library namespace
-
getThemes
Returns a slot handle to work with the themes within the library. Note that the order of the data sets within the slot is unimportant.- Returns:
- A handle for working with the themes.
-
getStyles
Deprecated.uses the theme insteadReturns a slot handle to work with the styles within the library.- Returns:
- A handle for working with the styles. Or
nullif the library has no values for the theme property
-
importCssStyles
Import css file to theme.- Overrides:
importCssStylesin classModuleHandleImpl- Parameters:
stylesheet- the style sheet handle that contains all the selected stylesselectedStyles- the selected style list
-
importCssStyles
Imports the selected styles in aCssStyleSheetHandleto the given theme of the library. 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 listthemeName- the name of the theme to put styles
-
getCubes
Description copied from class:ModuleHandleImplGets the slot handle to work with all cube elements within the report.- Specified by:
getCubesin classModuleHandleImpl- Returns:
- cube slot handle
-
getRelativeFileName
If this library is included by a module, return the relative file name that is defined in the host's xml file.- Returns:
- the relative file name that is defined in the host's xml file
-
isDirectionRTL
public boolean isDirectionRTL()Description copied from class:DesignElementHandleExamines whether the resolved direction of this design element is Right to Left or not.- Overrides:
isDirectionRTLin classDesignElementHandle- Returns:
- true if the direction is RTL, false otherwise
-
addConfigVariable
Description copied from class:ModuleHandleImplAdds a new config variable.- Overrides:
addConfigVariablein classModuleHandleImpl- Parameters:
configVar- the config variable- Throws:
SemanticException- if the name is empty or the same name exists.
-
addImage
Description copied from class:ModuleHandleImplAdds a new embedded image.- Overrides:
addImagein classModuleHandleImpl- Parameters:
image- the image to add- Throws:
SemanticException- if the name is empty, type is invalid, or the same name exists.
-
addTranslation
public void addTranslation(String resourceKey, String locale, String text) throws CustomMsgException Description copied from class:ModuleHandleImplAdds a new translation to the design.- Overrides:
addTranslationin classModuleHandleImpl- 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:
-
dropConfigVariable
Description copied from class:ModuleHandleImplDrops a config variable.- Overrides:
dropConfigVariablein classModuleHandleImpl- Parameters:
name- config variable name- Throws:
SemanticException- if no config variable is found.
-
dropImage
Description copied from class:ModuleHandleImplDrops an embedded image handle list from the design. Each one in the list is the instance ofEmbeddedImageHandle.- Overrides:
dropImagein classModuleHandleImpl- Parameters:
images- the image handle list to remove- Throws:
SemanticException- if any image in the list is not found.
-
dropImage
Description copied from class:ModuleHandleImplDrops an embedded image from the design.- Overrides:
dropImagein classModuleHandleImpl- Parameters:
name- the image name- Throws:
SemanticException- if the image is not found.
-
dropTranslation
Description copied from class:ModuleHandleImplDrops a translation from the design.- Overrides:
dropTranslationin classModuleHandleImpl- 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:
-
getComponents
Description copied from class:ModuleHandleImplReturns a slot handle to work with the top-level components within the report.- Overrides:
getComponentsin classModuleHandleImpl- Returns:
- A handle for working with the components.
-
getDataSets
Description copied from class:ModuleHandleImplReturns 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.- Overrides:
getDataSetsin classModuleHandleImpl- Returns:
- A handle for working with the data sets.
-
getDataSources
Description copied from class:ModuleHandleImplReturns 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.- Overrides:
getDataSourcesin classModuleHandleImpl- Returns:
- A handle for working with the data sources.
-
getFlattenParameters
Description copied from class:ModuleHandleImplReturns 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.- Overrides:
getFlattenParametersin classModuleHandleImpl- Returns:
- the sorted, flatten parameters and parameter groups.
-
getMasterPages
Description copied from class:ModuleHandleImplReturns 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.- Overrides:
getMasterPagesin classModuleHandleImpl- Returns:
- A handle for working with the master pages.
-
getParameters
Description copied from class:ModuleHandleImplReturns 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.- Overrides:
getParametersin classModuleHandleImpl- Returns:
- A handle for working with the parameters and parameter groups.
-
imagesIterator
Description copied from class:ModuleHandleImplReturns the iterator over all embedded images of this module instance. Each one is the instance ofEmbeddedImageHandle- Overrides:
imagesIteratorin classModuleHandleImpl- Returns:
- the iterator over all embedded images.
- See Also:
-
replaceConfigVariable
public void replaceConfigVariable(ConfigVariable oldVar, ConfigVariable newVar) throws SemanticException Description copied from class:ModuleHandleImplReplaces the old config variable with the new one.- Overrides:
replaceConfigVariablein classModuleHandleImpl- 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
Description copied from class:ModuleHandleImplReplaces the old embedded image with the new one.- Overrides:
replaceImagein classModuleHandleImpl- 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.
-
getAllStyles
Description copied from class:ModuleHandleImplReturns all style element handles that this modules and the included modules contain.- Overrides:
getAllStylesin classModuleHandleImpl- Returns:
- all style element handles that this modules and the included modules contain.
-
getVisibleThemes
Description copied from class:ModuleHandleImplReturns theme handles according the input level.- Overrides:
getVisibleThemesin classModuleHandleImpl- Parameters:
level- anintvalue, which should be the one defined inIVisibleLevelControl.- Returns:
- theme handles according the input level
-
getVisibleReportItemThemes
Description copied from class:ModuleHandleImplReturns report item theme handles according the input level.- Overrides:
getVisibleReportItemThemesin classModuleHandleImpl- Parameters:
level- anintvalue, which should be the one defined inIVisibleLevelControl.- Returns:
- theme handles according the input level
-
getParametersAndParameterGroups
Description copied from class:ModuleHandleImplReturns parameters and parameter groups on the module. Those parameters included in the parameter groups are not included in the return list.- Overrides:
getParametersAndParameterGroupsin classModuleHandleImpl- Returns:
- parameters and parameter groups
-
getAllPages
Description copied from class:ModuleHandleImplReturns all page handles that this modules and the included modules contain.- Overrides:
getAllPagesin classModuleHandleImpl- Returns:
- all page handles that this modules and the included modules contain.
-
shiftLibrary
Description copied from class:ModuleHandleImplShifts the library to new position. This method might affect the style reference, because the library order is changed.- Overrides:
shiftLibraryin classModuleHandleImpl- Parameters:
library- the library to shifttoPosn- the new position- Throws:
SemanticException- if error is encountered when shifting
-
includeLibrariesIterator
Description copied from class:ModuleHandleImplReturns the iterator over all included libraries. Each one is the instance ofIncludeLibraryHandle- Overrides:
includeLibrariesIteratorin classModuleHandleImpl- Returns:
- the iterator over all included libraries.
- See Also:
-
includeLibrary
public void includeLibrary(String libraryFileName, String namespace) throws DesignFileException, SemanticException Description copied from class:ModuleHandleImplIncludes one library with the given library file name. The new library will be appended to the library list.- Overrides:
includeLibraryin classModuleHandleImpl- 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
Description copied from class:ModuleHandleImplDrops the given library from the included libraries of this design file.- Overrides:
dropLibraryin classModuleHandleImpl- 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 Description copied from class:ModuleHandleImplReloads 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.
- Overrides:
reloadLibraryin classModuleHandleImpl- 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
Description copied from class:ModuleHandleImplReloads 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.
ModuleHandleImpl.reloadLibrary(LibraryHandle)- Overrides:
reloadLibrariesin classModuleHandleImpl- Throws:
SemanticExceptionDesignFileException
-
reloadLibrary
Description copied from class:ModuleHandleImplReloads 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.
- Overrides:
reloadLibraryin classModuleHandleImpl- 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
Description copied from class:ModuleHandleImplDrops the given library from the design and break all the parent/child relationships. All child element will be localized in the module.- Overrides:
dropLibraryAndBreakExtendsin classModuleHandleImpl- 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.
-
openCssStyleSheet
Description copied from class:ModuleHandleImplGets the result style sheet with given file name of an external CSS2 resource.- Overrides:
openCssStyleSheetin classModuleHandleImpl- 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
Description copied from class:ModuleHandleImplGets the result style sheet with given file name of an external CSS2 resource.- Overrides:
openCssStyleSheetin classModuleHandleImpl- 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
-
setThemeName
Description copied from class:ModuleHandleImplSets the theme to a report.- Overrides:
setThemeNamein classModuleHandleImpl- Parameters:
themeName- the name of the theme- Throws:
SemanticException
-
setTheme
Description copied from class:ModuleHandleImplSets the theme to a report.- Overrides:
setThemein classModuleHandleImpl- Parameters:
theme- the theme instance- Throws:
SemanticException
-