|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.SessionHandle
Represents the design state -- a session for a user. In the Eclipse environment, this represents the set of open designs. In the web environment, this represents open designs and locale for the session. A session has a set of default values for style properties and a default unit. The session also has methods to create and open designs.
A session can also provides the mechanism for specified file searching
algorithm. After get an new instance of SessionHandle, an algorithm of how to
search a file should be set by calling
if the default
resource locator is not the expected one.
setResourceLocator(IResourceLocator)
The default resource locator will search in the folder where the design file is located.
DefaultResourceLocator
,
DesignSession
Field Summary | |
protected org.eclipse.birt.report.model.core.DesignSession |
session
The implementation of the design session. |
Constructor Summary | |
SessionHandle(java.util.Locale locale)
Constructs a handle for the session with the given locale. |
Method Summary | |
void |
activate()
Activates this session within a thread. |
void |
closeAll(boolean save)
Closes all open designs and libraires. |
ReportDesignHandle |
createDesign()
Creates a new empty design. |
ReportDesignHandle |
createDesign(java.lang.String templateName)
Creates a new design based on a template. |
LibraryHandle |
createLibrary()
Creates a new empty library. |
java.lang.String |
getApplicationUnits()
Returns the current session (application) units. |
int |
getColorFormat()
Returns the current application rgb color display preference. |
java.lang.Object |
getDefaultValue(java.lang.String propName)
Gets the default value of the specified style property. |
java.util.Locale |
getLocale()
Returns the locale of the current session. |
IResourceLocator |
getResourceLocator()
Returns the installed resource locator. |
ReportDesignHandle |
openDesign(java.lang.String fileName)
Opens a design with the given the file name. |
ReportDesignHandle |
openDesign(java.lang.String fileName,
java.io.InputStream is)
Opens a design given a stream to the design and the the file name of the design. |
ReportDesignHandle |
openDesign(java.net.URL systemId,
java.io.InputStream is)
Opens a design given a stream to the design and the the file name of the design. |
LibraryHandle |
openLibrary(java.lang.String fileName)
Opens a library with the given the file name. |
LibraryHandle |
openLibrary(java.net.URL systemId,
java.io.InputStream is)
Opens a library with the given the file name. |
ModuleHandle |
openModule(java.lang.String fileName)
Opens a module regardless of the module type(library or report design). |
ModuleHandle |
openModule(java.lang.String fileName,
java.io.InputStream is)
Opens a module regardless of the module type(library or report design). |
void |
saveAll()
Saves all designs and librariesthat need a save. |
void |
setApplicationUnits(java.lang.String units)
Sets the units to be used by the application. |
void |
setColorFormat(int rgbFormat)
Sets the rgb color display preference to be used by the application. |
void |
setDefaultValue(java.lang.String propName,
java.lang.Object value)
Sets the specified default value of style property. |
void |
setResourceLocator(IResourceLocator locator)
Sets the resource locator for the specified file searching algorithm. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.eclipse.birt.report.model.core.DesignSession session
Constructor Detail |
public SessionHandle(java.util.Locale locale)
locale
- the user's locale. If null, then the system locale is assumed.Method Detail |
public void activate()
public ModuleHandle openModule(java.lang.String fileName, java.io.InputStream is) throws DesignFileException
fileName
- name of the file to open.is
- stream to read the design
DesignFileException
- If the file is not found, or the file contains fatal errors.public ModuleHandle openModule(java.lang.String fileName) throws DesignFileException
fileName
- name of the file to open.
DesignFileException
- If the file is not found, or the file contains fatal errors.public ReportDesignHandle openDesign(java.lang.String fileName) throws DesignFileException
fileName
- name of the file to open. It may contain the relative/absolute
path information. This name must include the file name with
the filename extension.
DesignFileException
- if the file is not found, or the file contains fatal errors.public ReportDesignHandle openDesign(java.lang.String fileName, java.io.InputStream is) throws DesignFileException
fileName
- name of the file to open. If null
, the design
will be treated as a new design, and will be saved to a
different file. If not null
, it may contain
the relative/absolute path information. This name must include
the file name with the filename extension.is
- stream to read the design
DesignFileException
- If the file is not found, or the file contains fatal errors.public ReportDesignHandle openDesign(java.net.URL systemId, java.io.InputStream is) throws DesignFileException
systemId
- the uri where to find the relative sources for the report.
This url is treated as an absolute directory.is
- the input stream to read the design
DesignFileException
- If the file is not found, or the file contains fatal errors.public LibraryHandle openLibrary(java.lang.String fileName) throws DesignFileException
fileName
- name of the file to open. This name must include the file name
with the filename extension.
DesignFileException
- if the file is not found, or the file contains fatal errors.public LibraryHandle openLibrary(java.net.URL systemId, java.io.InputStream is) throws DesignFileException
systemId
- the uri where to find the relative sources for the library.
This url is treated as an absolute directory.is
- the input stream
DesignFileException
- if the file is not found, or the file contains fatal errors.public ReportDesignHandle createDesign(java.lang.String templateName)
null
if no template is desired.
templateName
- The name of the template for the design, or null
if no template is needed.
public ReportDesignHandle createDesign()
public LibraryHandle createLibrary()
public void saveAll() throws java.io.IOException
java.io.IOException
- if a save error occurspublic void closeAll(boolean save) throws java.io.IOException
save
- true
if designs are to be saved before closing
java.io.IOException
- if a save error occurspublic void setApplicationUnits(java.lang.String units) throws PropertyValueException
DesignChoiceConstants
and
can be one of:
UNITS_IN
UNITS_CM
UNITS_MM
UNITS_PT
UNITS_PC
units
- the units to set for the session -- application
PropertyValueException
- if units
is not one of the aboveDimensionValue
public java.lang.String getApplicationUnits()
DesignChoiceConstants
and is one of:
UNITS_IN
UNITS_CM
UNITS_MM
UNITS_PT
UNITS_PC
setApplicationUnits(java.lang.String)
public void setColorFormat(int rgbFormat) throws PropertyValueException
ColorUtil
:
INT_FORMAT
HTML_FORMAT
JAVA_FORMAT
CSS_ABSOLUTE_FORMAT
CSS_RELATIVE_FORMAT
rgbFormat
- the rgb color display preference to set.
PropertyValueException
- if rgbFormat
is not one of the above.ColorPropertyType
public int getColorFormat()
ColorUtil
:
INT_FORMAT
HTML_FORMAT
JAVA_FORMAT
CSS_ABSOLUTE_FORMAT
CSS_RELATIVE_FORMAT
setColorFormat(int)
public void setDefaultValue(java.lang.String propName, java.lang.Object value) throws PropertyValueException
propName
- style property namevalue
- default value to set
PropertyValueException
- if value is invalid.public java.lang.Object getDefaultValue(java.lang.String propName)
propName
- style property name
null
.public void setResourceLocator(IResourceLocator locator)
locator
- the resource locator to be set.public IResourceLocator getResourceLocator()
public java.util.Locale getLocale()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |