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

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

public class ThemeHandle
extends ReportElementHandle
implements org.eclipse.birt.report.model.elements.interfaces.IThemeModel

Represents a theme in the library. Each theme contains some number of styles.

See Also:
Theme

Field Summary
 
Fields inherited from class org.eclipse.birt.report.model.api.ReportElementHandle
element
 
Fields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
module
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IThemeModel
CSSES_PROP, DEFAULT_THEME_NAME, STYLES_SLOT
 
Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
COMMENTS_PROP, CUSTOM_XML_PROP, DISPLAY_NAME_ID_PROP, DISPLAY_NAME_PROP, EVENT_HANDLER_CLASS_PROP, EXTENDS_PROP, FULL_LABEL, ID_SUFFIX, NAME_PROP, NO_SLOT, PROPERTY_MASKS_PROP, REF_TEMPLATE_PARAMETER_PROP, SHORT_LABEL, USER_LABEL, USER_PROPERTIES_PROP, VIEW_ACTION_PROP
 
Constructor Summary
ThemeHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
          Constructs the handle for a theme with the given design and element.
 
Method Summary
 void addCss(CssStyleSheetHandle sheetHandle)
          Includes one css with the given css file name.
 void addCss(IncludedCssStyleSheet cssStruct)
          Includes one CSS structure with the given IncludedCssStyleSheet.
 void addCss(java.lang.String fileName)
          Includes one css with the given css file name.
 boolean canAddCssStyleSheet(CssStyleSheetHandle sheetHandle)
          Check style sheet can be added or not.
 boolean canAddCssStyleSheet(java.lang.String fileName)
          Check style sheet can be added or not.
 boolean canDropCssStyleSheet(CssStyleSheetHandle sheetHandle)
          Check style sheet can be droped or not.
 boolean canRenameCss(IncludedCssStyleSheetHandle handle, java.lang.String newFileName)
          Checks included style sheet can be renamed or not.
 void dropCss(CssStyleSheetHandle sheetHandle)
          Drops the given css style sheet of this design file.
 CssStyleSheetHandle findCssStyleSheetHandleByName(java.lang.String fileName)
          Gets CssStyleSheetHandle by file name.
 IncludedCssStyleSheetHandle findIncludedCssStyleSheetHandleByName(java.lang.String fileName)
          Gets IncludedCssStyleSheetHandle by file name.
 StyleHandle findStyle(java.lang.String name)
          Returns the style with the given name.
 java.util.List getAllCssStyleSheets()
          Gets all css styles sheet
 java.util.List getAllStyles()
          Gets all styles in theme,include css file.
 java.lang.String getDisplayLabel(int level)
          Returns the display label for this element.
 SlotHandle getStyles()
          Returns the styles slot of row.
 java.util.Iterator includeCssesIterator()
          Returns the iterator over all included css style sheets.
 void reloadCss(CssStyleSheetHandle sheetHandle)
          Reloads the css with the given css file path.
 void renameCss(IncludedCssStyleSheetHandle handle, java.lang.String newFileName)
          Renames both IncludedCssStyleSheet and CSSStyleSheet to newFileName.
 
Methods inherited from class org.eclipse.birt.report.model.api.ReportElementHandle
getComments, getCustomXml, getDisplayName, getDisplayNameKey, getElement, getPropertyMask, isValidLayoutForCompoundElement, isValidReferenceForCompoundElement, propertyMaskIterator, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setPropertyMask
 
Methods inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
add, add, addElement, addElement, addListener, addUserPropertyDefn, cachePropertyHandles, canContain, canContain, canContain, canContain, canDrop, canEdit, canTransformToTemplate, clearAllProperties, clearContents, clearProperty, clientsIterator, copy, copyPropertyTo, createTemplateElement, derivedIterator, doSort, drop, drop, drop, dropAndClear, dropAndClear, dropAndClear, dropUserPropertyDefn, findContentSlot, getBooleanProperty, getChoices, getColorProperty, getContainer, getContainerPropertyHandle, getContainerSlotHandle, getContent, getContentCount, getContents, getDefn, getDesign, getDesignHandle, getDimensionProperty, getDisplayLabel, getDisplayProperty, getEffectiveModule, getElementFactory, getElementProperty, getEventHandlerClass, getExtends, getExternalizedValue, getExternalizedValue, getExternalizedValue, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getFullName, getHostViewHandle, getID, getIndex, getIntProperty, getListProperty, getListProperty, getMethods, getModule, getModuleHandle, getName, getNumberProperty, getPrivateStyle, getProperty, getPropertyBinding, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getUserProperties, getUserPropertyDefnHandle, getXPath, hasLocalProperties, hasSemanticError, initializeSlotHandles, isDirectionRTL, isInTemplateParameter, isTemplateParameterValue, isValid, localize, move, move, moveTo, moveTo, moveTo, moveTo, paste, paste, paste, paste, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setEncryption, setEventHandlerClass, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setName, setNumberProperty, setProperties, setProperty, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeHandle

public ThemeHandle(org.eclipse.birt.report.model.core.Module module,
                   org.eclipse.birt.report.model.core.DesignElement element)
Constructs the handle for a theme with the given design and element. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.

Parameters:
module - the module
element - the model representation of the element
Method Detail

getStyles

public SlotHandle getStyles()
Returns the styles slot of row. Through SlotHandle, each style can be obtained.

Returns:
the handle to the style slot
See Also:
SlotHandle

getAllStyles

public java.util.List getAllStyles()
Gets all styles in theme,include css file.

Returns:
all styles.each item is StyleHandle

getAllCssStyleSheets

public java.util.List getAllCssStyleSheets()
Gets all css styles sheet

Returns:
each item is CssStyleSheetHandle

findStyle

public StyleHandle findStyle(java.lang.String name)
Returns the style with the given name.

Parameters:
name - the style name
Returns:
the corresponding style

getDisplayLabel

public java.lang.String getDisplayLabel(int level)
Description copied from class: DesignElementHandle
Returns the display label for this element. The display label is the localized display name to be shown in the UI. The display label is one of the following:

The user can also decide at which detail level the display label should be returned. The level can be one of the following options:

Overrides:
getDisplayLabel in class DesignElementHandle
Parameters:
level - the display label detail level
Returns:
the display label of this element in a given level

includeCssesIterator

public java.util.Iterator includeCssesIterator()
Returns the iterator over all included css style sheets. Each one is the instance of IncludedCssStyleSheetHandle

Returns:
the iterator over all included css style sheets.

addCss

public void addCss(CssStyleSheetHandle sheetHandle)
            throws SemanticException
Includes one css with the given css file name. The new css will be appended to the css list.

Parameters:
sheetHandle - css style sheet handle
Throws:
SemanticException - if error is encountered when handling CssStyleSheet structure list.

addCss

public void addCss(IncludedCssStyleSheet cssStruct)
            throws SemanticException
Includes one CSS structure with the given IncludedCssStyleSheet. The new css will be appended to the CSS list.

Parameters:
cssStruct - the CSS structure
Throws:
SemanticException - if error is encountered when handling CssStyleSheet structure list.

addCss

public void addCss(java.lang.String fileName)
            throws SemanticException
Includes one css with the given css file name. The new css will be appended to the css list.

Parameters:
fileName - css file name
Throws:
SemanticException - if error is encountered when handling CssStyleSheet structure list.

dropCss

public void dropCss(CssStyleSheetHandle sheetHandle)
             throws SemanticException
Drops the given css style sheet of this design file.

Parameters:
sheetHandle - the css to drop
Throws:
SemanticException - if error is encountered when handling CssStyleSheet structure list. Or it maybe because that the given css is not found in the design. Or that the css has descedents in the current module

canDropCssStyleSheet

public boolean canDropCssStyleSheet(CssStyleSheetHandle sheetHandle)
Check style sheet can be droped or not.

Parameters:
sheetHandle -
Returns:
true can be dropped.else return false

canAddCssStyleSheet

public boolean canAddCssStyleSheet(CssStyleSheetHandle sheetHandle)
Check style sheet can be added or not.

Parameters:
sheetHandle -
Returns:
true can be added.else return false

canAddCssStyleSheet

public boolean canAddCssStyleSheet(java.lang.String fileName)
Check style sheet can be added or not.

Parameters:
fileName -
Returns:
true can be added.else return false

reloadCss

public void reloadCss(CssStyleSheetHandle sheetHandle)
               throws SemanticException
Reloads the css with the given css file path. If the css already is included directly, reload it. If the css is not included, exception will be thrown.

Parameters:
sheetHandle - css style sheet handle
Throws:
SemanticException - if error is encountered when handling CssStyleSheet structure list. Or it maybe because that the given css is not found in the design. Or that the css has descedents in the current module

findCssStyleSheetHandleByName

public CssStyleSheetHandle findCssStyleSheetHandleByName(java.lang.String fileName)
Gets CssStyleSheetHandle by file name.

Parameters:
fileName - the file name.
Returns:
the cssStyleSheet handle.

findIncludedCssStyleSheetHandleByName

public IncludedCssStyleSheetHandle findIncludedCssStyleSheetHandleByName(java.lang.String fileName)
Gets IncludedCssStyleSheetHandle by file name.

Parameters:
fileName - the file name
Returns:
the includedCssStyleSheet handle.

renameCss

public void renameCss(IncludedCssStyleSheetHandle handle,
                      java.lang.String newFileName)
               throws SemanticException
Renames both IncludedCssStyleSheet and CSSStyleSheet to newFileName.

Parameters:
handle - the includedCssStyleSheetHandle
newFileName - the new file name
Throws:
SemanticException

canRenameCss

public boolean canRenameCss(IncludedCssStyleSheetHandle handle,
                            java.lang.String newFileName)
                     throws SemanticException
Checks included style sheet can be renamed or not.

Parameters:
handle - the included css style sheet handle.
newFileName - the new file name.
Returns:
true can be renamed.else return false
Throws:
SemanticException


Copyright © 2008 Actuate Corp. All rights reserved.